P27319 [AtCoder] Amary
提高+
题目描述

Problem Description

Score : $ 300 $ points

penguinman had two positive integers $ A $ and $ B $, but he lost them. He claims that $ A $ and $ B $ had the following properties:

  • The remainder when $ A $ is divided by $ B $ is $ X $
  • The remainder when $ B $ is divided by $ A $ is $ Y $
  • $1 \leq A, B \leq 10^{18}$
  • $ A $ and $ B $ are both integers

Determine if a pair of $ A $ and $ B $ that matches his testimony exists, and if so, construct one possible pair.

Input Format

The input is given from the standard input in the following format:

\(X\) \(Y\)

Output Format

If no pair of $ A $ and $ B $ matches the testimony, output $ -1 $.

If a pair exists, output one possible pair of $ A $ and $ B $ separated by a space.

If multiple answers exist, any one of them is acceptable.

Sample Input and Output

Sample Input #1

10 9

Sample Output #1

10 19

Sample Input #2

10 10

Sample Output #2

-1

Notes/Hints

None

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
10 9
样例输出
10 19