PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000273. Tam giác có diện tích bằng một (S = 1)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Tam giác có diện tích bằng một (S = 1)

S = 1

Source: AtCoder

Version: Phuoc Hung OJ Extended

Problem Statement

Given two integers X,YX,Y, at least one of which is nonzero, consider the three points (0,0)(0,0), (X,Y)(X,Y) and (A,B)(A,B) in the coordinate plane.

Find any integer pair (A,B)(A,B) for which the triangle has area exactly 11, with both coordinates in [−1018,1018][-10^{18},10^{18}].

If no such integer pair exists, output -1. Any valid pair is accepted.

Input

One line contains two integers X,YX,Y.

Output

Print two integers A,BA,B forming any valid pair, or -1 if none exists.

Subtasks

  • Subtask 1 (20 points): −100≤X,Y≤100-100\le X,Y\le 100; (X,Y)≠(0,0)(X,Y)\ne(0,0); −1018≤A,B≤1018-10^{18}\le A,B\le10^{18}.
  • Subtask 2 (30 points): −1000000000≤X,Y≤1000000000-1000000000\le X,Y\le 1000000000; (X,Y)≠(0,0)(X,Y)\ne(0,0); −1018≤A,B≤1018-10^{18}\le A,B\le10^{18}.
  • Subtask 3 (50 points): −100000000000000000≤X,Y≤100000000000000000-100000000000000000\le X,Y\le 100000000000000000; (X,Y)≠(0,0)(X,Y)\ne(0,0); −1018≤A,B≤1018-10^{18}\le A,B\le10^{18}.

Examples

Example 1

Input

3 5

Output

1 1

Explanation

The determinant is 3⋅1−5⋅1=−23\cdot1-5\cdot1=-2, so the area is 11.

Example 2

Input

-2 0

Output

0 1

Explanation

The determinant is −2⋅1−0⋅0=−2-2\cdot1-0\cdot0=-2, so the area is 11.

Example 3

Input

8752654402832944 -6857065241301125

Output

-1

Explanation

The gcd of the two coordinates does not divide 22, hence area 11 is impossible.