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

#GL0000274. Điểm nguyên trên đường thẳng (Line)

HỌC THEO LỘ TRÌNH

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

1 lộ trình

Điểm nguyên trên đường thẳng (Line)

Line

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

A line on the coordinate plane is given by Ax+By+C=0Ax+By+C=0, where A2+B2>0A^2+B^2>0.

Find any integer point (x,y)(x,y) on this line, with both coordinates in [−5⋅1018,5⋅1018][-5\cdot10^{18},5\cdot10^{18}].

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

Input

One line contains three integers A,B,CA,B,C.

Output

Print two integers x,yx,y defining any valid point, or -1 if none exists.

Subtasks

  • Subtask 1 (20 points): −100≤A,B,C≤100-100\le A,B,C\le 100; A2+B2>0A^2+B^2>0; −5⋅1018≤x,y≤5⋅1018-5\cdot10^{18}\le x,y\le5\cdot10^{18}.
  • Subtask 2 (30 points): −1000000≤A,B,C≤1000000-1000000\le A,B,C\le 1000000; A2+B2>0A^2+B^2>0; −5⋅1018≤x,y≤5⋅1018-5\cdot10^{18}\le x,y\le5\cdot10^{18}.
  • Subtask 3 (50 points): −2000000000≤A,B,C≤2000000000-2000000000\le A,B,C\le 2000000000; A2+B2>0A^2+B^2>0; −5⋅1018≤x,y≤5⋅1018-5\cdot10^{18}\le x,y\le5\cdot10^{18}.

Examples

Example 1

Input

2 5 3

Output

6 -3

Explanation

Substitution gives 2⋅6+5⋅(−3)+3=02\cdot6+5\cdot(-3)+3=0.