A line on the plane is described by an equation Ax + By + C = 0. You are to find any point on this line, whose coordinates are integer numbers from  - 5·1018 to 5·1018 inclusive, or to find out that such points do not exist.

Input

The first line contains three integers A, B and C ( - 2·109 ≤ A, B, C ≤ 2·109) — corresponding coefficients of the line equation. It is guaranteed that A2 + B2 > 0.

Output

If the required point exists, output its coordinates, otherwise output -1.

Examples

Input

2 5 3


Output

6 -3

Difficulty: MEDIUM_HARD
Tags: Number theory

Mathematics

Starter code:

Solutions:
def gcd(x, y):
	if x % y == 0:
		return y
	else:
		return gcd(y, x % y)

def bezout(x, y):
	if x % y == 0:
		return (0, 1)
	else:
		(t, s) = bezout(y, x % y)
		return (s, t - x // y * s)
(a, b, c) = map(int, input().split())
if a == 0:
	if c % b == 0:
		print('%d %d' % (0, -c // b))
	else:
		print(-1)
	exit()
if b == 0:
	if c % a == 0:
		print('%d %d' % (-c // a, 0))
	else:
		print(-1)
	exit()
if c % gcd(a, b) != 0:
	print(-1)
else:
	(x, y) = bezout(a, b)
	m = -c // gcd(a, b)
	print('%d %d' % (m * x, m * y))


def CF_7C():
	(A, B, C) = list(map(int, input().split()))
	if A == 0:
		if C % B != 0:
			print(-1)
		else:
			print(0, -C // B)
	elif B == 0:
		if C % A != 0:
			print(-1)
		else:
			print(-C // A, 0)
	else:
		(s, t, g) = extended_gcd(A, B)
		(x, y) = (-s * C // g, -t * C // g)
		if A * x + B * y + C != 0:
			print(-1)
		else:
			print(x, y)
	return

def gcd(a, b):
	if b != 0:
		return gcd(b, a % b)
	else:
		return a

def extended_gcd(a, b):
	q = []
	while b != 0:
		q.append(a // b)
		(a, b) = (b, a % b)
	s = [1, 0]
	t = [0, 1]
	for i in range(0, len(q)):
		s.append(s[-2] - q[i] * s[-1])
		t.append(t[-2] - q[i] * t[-1])
	return (s[-2], t[-2], a)
CF_7C()


def gcd(a, b):
	if a == 0:
		return (0, 1, b)
	(x, y, g) = gcd(b % a, a)
	return (y - b // a * x, x, g)
(a, b, c) = map(int, input().split())
c = -c
(x, y, g) = gcd(a, b)
if c % g != 0:
	print('-1')
else:
	x *= c // g
	y *= c // g
	print(x, y)


(a, b, c) = map(int, input().split())

def exgcd(a, b):
	if b == 0:
		return (a, 1, 0)
	(gcd, x, y) = exgcd(b, a % b)
	k = -(a // b)
	xx = y
	yy = x + y * k
	return (gcd, xx, yy)
(gcd, x0, y0) = exgcd(a, b)
if c % gcd != 0:
	print(-1)
else:
	k = -c // gcd
	print(k * x0, k * y0)


import math

def gcdExtended(a, b):
	if a == 0:
		return (b, 0, 1)
	(gcd, x1, y1) = gcdExtended(b % a, a)
	x = y1 - b // a * x1
	y = x1
	return (gcd, x, y)
(a, b, c) = map(int, input().split())
if a == 0:
	if c % b == 0:
		print(0, -c // b)
	else:
		print(-1)
elif b == 0:
	if c % a == 0:
		print(-c // a, 0)
	else:
		print(-1)
elif c % math.gcd(a, b) != 0:
	print(-1)
else:
	(gcd, p, q) = gcdExtended(a, b)
	print(p * (-c // gcd), q * (-c // gcd))


(a, b, c) = map(int, input().split())
(r0, r1, s0, s1, t0, t1) = (a, b, 1, 0, 0, 1)
while r1:
	(q, r2) = divmod(r0, r1)
	(q, r2) = (r0 // r1, r0 % r1)
	(r0, r1) = (r1, r2)
	(s0, s1) = (s1, s0 - q * s1)
	(t0, t1) = (t1, t0 - q * t1)
if c % r0:
	print(-1)
else:
	print(s0 * -c // r0, t0 * -c // r0)


import sys

def extGCD(a, b, xa, xb):
	if b == 0:
		return (a, xa)
	q = a // b
	return extGCD(b, a - q * b, xb, xa - q * xb)
(a, b, c) = map(int, input().split())
c = -c
(d, x) = extGCD(a, b, 1, 0)
if c % d != 0:
	print(-1)
else:
	x *= c // d
	if b == 0:
		y = 0
	else:
		y = (c - x * a) // b
	print(x, y)


def e(a, b):
	if not a:
		return (0, 1, b)
	(x, y, g) = e(b % a, a)
	return (y - b // a * x, x, g)
(a, b, c) = map(int, input().split())
(x, y, g) = e(a, b)
C = -c // g
print(-1) if c % g else print(C * x, C * y)


def extendedGCD(a, b):
	if b == 0:
		x = 1
		y = 0
		return (x, y, a)
	(x, y, g) = extendedGCD(b, a % b)
	z = x - a // b * y
	return (y, z, g)
(A, B, C) = (int(x) for x in input().split())
if A == 0 and B == 0:
	if C == 0:
		print(1, 1)
	else:
		print(-1)
elif A == 0:
	if C % B == 0:
		print(1, -C // B)
	else:
		print(-1)
elif B == 0:
	if C % A == 0:
		print(-C // A, 1)
	else:
		print(-1)
else:
	(x, y, gcd) = extendedGCD(A, B)
	X = x * -C // gcd
	Y = y * -C // gcd
	if -5e+18 <= X <= 5e+18 and -5e+18 <= Y <= 5e+18 and (A * X + B * Y + C == 0):
		print(X, Y)
	else:
		print(-1)


def egcd(a, b, xa, xb):
	if b == 0:
		return (a, xa)
	q = a // b
	return egcd(b, a - q * b, xb, xa - q * xb)
(a, b, c) = map(int, input().split())
c = -c
(d, x) = egcd(a, b, 1, 0)
if c % d != 0:
	print(-1)
else:
	x *= c // d
	if b == 0:
		y = 0
	else:
		y = (c - x * a) // b
	print(x, y)


def gcd(a, b):
	return gcd(b % a, a) if a else b

def f(a, b):
	if a == 1:
		return (1, 0)
	(y, x) = f(b % a, a)
	return (-x - y * (b // a), -y)
(a, b, c) = map(int, input().split())
if c:
	if a:
		if b:
			if c < 0:
				(a, b, c) = (-a, -b, -c)
			(i, j) = (a < 0, b < 0)
			(a, b) = (abs(a), abs(b))
			k = gcd(a, b)
			if c % k:
				print(-1)
			else:
				(a, b, c) = (a // k, b // k, c // k)
				u = gcd(b, c)
				v = gcd(a, c)
				(a, c) = (a // v, c // v)
				(b, c) = (b // u, c // u)
				(x, y) = f(a, b)
				if not i:
					x = -x
				if j:
					y = -y
				print(c * x * u, c * y * v)
		elif c % a:
			print(-1)
		else:
			print(-c // a, 0)
	elif c % b:
		print(-1)
	else:
		print(0, -c // b)
else:
	print(-b, a)


def gcd(a, b):
	if b == 0:
		return (1, 0, a)
	(alphap, betap, d) = gcd(b, a % b)
	return (betap, alphap - a // b * betap, d)
(a, b, c) = map(int, input().split())
c = -c
(al, be, d) = gcd(a, b)
if c % d == 0:
	(x0, y0, lim) = (c // d * al, c // d * be, 5 * 10 ** 18)
	if -lim < x0 < lim and -lim < y0 < lim:
		print(x0, y0)
	else:
		print('-1')
else:
	print('-1')


def main():
	(a, b, c) = map(int, input().split())
	(x, x1) = (1, 0)
	(y, y1) = (0, 1)
	while b != 0:
		q = a // b
		(a, b) = (b, a % b)
		(x, x1) = (x1, x - q * x1)
		(y, y1) = (y1, y - q * y1)
	if c % a == 0:
		if -5 * 10 ** 18 <= x <= 5 * 10 ** 18 and -5 * 10 ** 18 <= y <= 5 * 10 ** 18:
			print(x * (-c // a), y * (-c // a))
		else:
			print(-1)
	else:
		print(-1)
main()


(alph, beth, d) = (0, 0, 0)

def gcd(a, b):
	global alph
	global beth
	global d
	if b == 0:
		d = a
		alph = 1
		beth = 0
	else:
		gcd(b, a % b)
		temp = alph
		alph = beth
		beth = temp - a // b * beth

def main():
	A = [int(i) for i in input().split()]
	(a, b, c) = (A[0], A[1], A[2])
	c *= -1
	gcd(a, b)
	xc = c // d * alph
	yc = c // d * beth
	if c % d != 0:
		print(-1)
	else:
		print(int(xc), int(yc))
main()


(a, b, c) = (int(x) for x in input().split())
(x, x1) = (1, 0)
(y, y1) = (0, 1)
while b != 0:
	q = a // b
	(a, b) = (b, a % b)
	(x, x1) = (x1, x - q * x1)
	(y, y1) = (y1, y - q * y1)
if c % a == 0:
	x *= -c // a
	y *= -c // a
	mn = -5 * 10 ** 18
	mx = 5 * 10 ** 18
	if mn <= x <= mx and mn <= y <= mx:
		print(x, y)
	else:
		print(-1)
else:
	print(-1)


def main():
	(a, b, c) = map(int, input().split())
	(x, x1) = (1, 0)
	(y, y1) = (0, 1)
	while b:
		q = a // b
		(a, b) = (b, a - b * q)
		(x, x1) = (x1, x - x1 * q)
		(y, y1) = (y1, y - y1 * q)
	if c % a:
		print(-1)
	else:
		c //= -a
		print(c * x, c * y)
main()


import sys

def gcd(a, b):
	LT = []
	while b > 0:
		if a % b != 0:
			LT.append([1, -(a // b)])
		(a, b) = (b, a % b)
	return (LT, a)
(A, B, C) = map(int, input().split())
if B <= 0:
	A = -1 * A
	B = -1 * B
	C = -1 * C
if A == 0 and B != 0:
	y = -C // B
	if C % B != 0:
		print(-1)
	else:
		print('{} {}'.format(0, y))
	sys.exit()
elif B == 0 and A != 0:
	x = -C // A
	if C % A != 0:
		print(-1)
	else:
		print('{} {}'.format(x, 0))
	sys.exit()
elif B == 0 and A == 0:
	if C != 0:
		print(-1)
	else:
		print('{} {}'.format(0, 0))
	sys.exit()
(lt, dt) = gcd(A, B)
n = len(lt)
if n == 0:
	if -C % A == 0 and -C % B != 0:
		print('{} {}'.format(-C // A, 0))
	elif -C % B == 0 and -C % A != 0:
		print('{} {}'.format(0, -C // B))
	elif -C % B == 0 and -C % A == 0:
		print('{} {}'.format(0, -C // B))
	sys.exit()
for i in range(n - 1, 0, -1):
	lt[i - 1][0] = lt[i - 1][0] * lt[i][1]
	lt[i - 1][1] = lt[i - 1][1] * lt[i][1] + lt[i][0]
x = -lt[0][0] * C // dt
y = -lt[0][1] * C // dt
if x * A + y * B + C != 0:
	print(-1)
else:
	print('{} {}'.format(x, y))


(X, Y, C) = map(int, input().split())

def gcdExt(a, b):
	(prevx, x) = (1, 0)
	(prevy, y) = (0, 1)
	while b:
		q = a // b
		(x, prevx) = (prevx - q * x, x)
		(y, prevy) = (prevy - q * y, y)
		(a, b) = (b, a % b)
	return (a, prevx, prevy)
(mcd, x, y) = gcdExt(X, Y)
c = C
if -c % mcd == 0:
	k = -c // mcd
	print(x * k, y * k)
else:
	print(-1)


import sys

def solve():
	(a, b, c) = map(int, input().split())
	(gcd, amul, bmul) = egcd(a, b)
	if c % gcd != 0:
		print(-1)
		return
	first = amul * c // gcd
	second = bmul * c // gcd
	for i in range(-1, 2, 2):
		for j in range(-1, 2, 2):
			if a * first * i + b * second * j == -c:
				print(first * i, second * j)
				return
	print(-1)

def egcd(a, b):
	s = 0
	old_s = 1
	t = 1
	old_t = 0
	r = b
	old_r = a
	while r != 0:
		quotient = old_r // r
		(old_r, r) = (r, old_r - quotient * r)
		(old_s, s) = (s, old_s - quotient * s)
		(old_t, t) = (t, old_t - quotient * t)
	return (old_r, old_s, old_t)
if sys.hexversion == 50594544:
	sys.stdin = open('test.txt')
ans = solve()


import sys
input = sys.stdin.readline
from math import gcd

def lcm(a, b):
	return a * b // gcd(a, b)

def ext_gcd(a, b):
	if b:
		(d, y, x) = ext_gcd(b, a % b)
		y -= a // b * x
		return (d, x, y)
	return (a, 1, 0)
(a, b, c) = map(int, input().split())
c *= -1
if a == 0:
	if c % b == 0:
		print(0, c // b)
	else:
		print(-1)
elif b == 0:
	if c % a == 0:
		print(c // a, 0)
	else:
		print(-1)
elif c == 0:
	print(-b, a)
else:
	g = gcd(a, b)
	if c % g:
		print(-1)
		exit()
	(d, x, y) = ext_gcd(a, b)
	r = c // g
	x *= r
	y *= r
	if a * x + b * y == c:
		print(x, y)
	else:
		print(-x, -y)


def exgcd(a, b):
	if 0 == b:
		return (1, 0, a)
	(x, y, q) = exgcd(b, a % b)
	(x, y) = (y, x - a // b * y)
	return (x, y, q)

def main():
	(a, b, c) = map(int, input().split())
	c = -c
	(x, y, q) = exgcd(a, b)
	if c % q == 0:
		print('%d %d' % (c // q * x, c // q * y))
	else:
		print(-1)
main()


x0 = 1
y0 = 1
d = 0

def euclides(a, b):
	global x0, y0, d
	if b == 0:
		x0 = 1
		y0 = 0
		d = a
		return
	euclides(b, a % b)
	x1 = y0
	y1 = x0 - a // b * y0
	x0 = x1
	y0 = y1
(a, b, c) = [int(x) for x in input().split()]
euclides(a, b)
if c % d != 0:
	print(-1)
else:
	x_sol = -c * x0 // d
	y_sol = -c * y0 // d
	if -5 * 10 ** 18 <= x_sol and x_sol <= 5 * 10 ** 18 and (-5 * 10 ** 18 <= y_sol) and (y_sol <= 5 * 10 ** 18):
		print('{} {}'.format(x_sol, y_sol))
	else:
		print(-1)


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
from math import sqrt, floor, factorial, gcd, log
from collections import deque, Counter, defaultdict
from itertools import permutations
from math import gcd
from bisect import bisect
input = lambda : sys.stdin.readline().rstrip('\r\n')
read = lambda : list(map(int, input().strip().split(' ')))

def gcdExtended(a, b):
	if a == 0:
		return (b, 0, 1)
	(gcd, x1, y1) = gcdExtended(b % a, a)
	x = y1 - b // a * x1
	y = x1
	return (gcd, x, y)

def solve():
	(a, b, c) = read()
	if c % gcd(a, b) != 0:
		print(-1)
		exit()
	(d, x, y) = gcdExtended(a, b)
	print(x * (-c // d), y * (-c // d))
solve()


def ext_gcd(a, b):
	if not b:
		return (1, 0, a)
	(x, y, g) = ext_gcd(b, a % b)
	(x, y) = (y, x - a // b * y)
	return (x, y, g)
co = input().split()
(A, B, C) = (int(co[0]), int(co[1]), int(co[2]))
(x, y, g) = ext_gcd(A, B)
if not C % g:
	print(-x * C // g, -y * C // g)
else:
	print(-1)


def gc(a, b):
	if a == 0:
		return (0, 1)
	else:
		(x, y) = gc(b % a, a)
	return (y - b // a * x, x)
import math
(a, b, c) = map(int, input().split())
x = -5 * 10 ** 18
if b == 0:
	if c % a == 0:
		print(-c // a, 0)
	else:
		print('-1')
	exit()
elif a == 0:
	if c % b == 0:
		print(0, -c // b)
	else:
		print('-1')
	exit()
d = math.gcd(a, b)
if c % d != 0:
	print('-1')
	exit()
c = -c
sx = a // abs(a)
sy = b // abs(b)
if abs(a) > abs(b):
	(x, y) = gc(abs(b), abs(a))
	print(sx * y * c // d, sy * x * c // d)
else:
	(x, y) = gc(abs(a), abs(b))
	print(sx * x * c // d, sy * y * c // d)


import math
ABC = [int(i) for i in input().split()]
A = ABC[0]
B = ABC[1]
C = ABC[2]

def gcd_euclidean(a, b):
	r = a % b
	if r == 0:
		return (b, 0, 1)
	else:
		(g, x, y) = gcd_euclidean(b, r)
		return (g, y, x - a // b * y)
max_num = int(5e+18)
if A == 0:
	if C % B == 0:
		print(0, -C // B)
	else:
		print(-1)
elif B == 0:
	if C % A == 0:
		print(0, -C // A)
	else:
		print(-1)
else:
	(g, x, y) = gcd_euclidean(A, B)
	if C % g == 0:
		k = C // g
		kx = -k * x
		ky = -k * y
		if abs(kx) > max_num or abs(ky) > max_num:
			print(-1)
		else:
			print(kx, ky)
	else:
		print(-1)


import math

def main():
	INF = int(5e+18)
	(a, b, c) = map(int, input().split())
	g = math.gcd(a, b)
	if c % g != 0:
		print(-1)
		return
	a //= g
	b //= g
	c //= g
	(s1, t1) = (1, 0)
	(s2, t2) = (0, 1)
	(r1, r2) = (a, b)
	while r2 != 0:
		q = r1 // r2
		(s1, s2) = (s2, s1 - q * s2)
		(t1, t2) = (t2, t1 - q * t2)
		(r1, r2) = (r2, r1 % r2)
	if b < 0:
		b *= -1
		a *= -1
		c *= -1
	(x, y) = (s1, t1)
	if -c * x < INF:
		while -c * x <= INF:
			if -INF <= -c * x <= INF and -INF <= -c * y <= INF:
				print(-c * x, -c * y)
				return
			x += b
			y -= a
	else:
		while -INF <= -c * x:
			if -INF <= -c * x <= INF and -INF <= -c * y <= INF:
				print(-c * x, -c * y)
				return
			x -= b
			y += a
	print(-1)
main()


vals = input().split()
(A, B, C) = (int(vals[0]), int(vals[1]), int(vals[2]))
max_num = int(5e+18)

def gcdExtended(a, b):
	if a == 0:
		return (b, 0, 1)
	(gcd, x1, y1) = gcdExtended(b % a, a)
	x = y1 - b // a * x1
	y = x1
	return (gcd, x, y)
if A == 0:
	if C % B == 0:
		print(0, -C // B)
	else:
		print(-1)
elif B == 0:
	if C % A == 0:
		print(-C // A, 0)
	else:
		print(-1)
else:
	(gcd, x, y) = gcdExtended(A, B)
	if C % gcd == 0:
		k = C // gcd
		kx = -k * x
		ky = -k * y
		if abs(kx) > max_num:
			print(-1)
		else:
			print(kx, ky)
	else:
		print(-1)


__author__ = 'Darren'

def solve():
	(a, b, c) = map(int, input().split())
	params = extended_euclidean(a, b)
	if c % params[0] != 0:
		print(-1)
	else:
		factor = -c // params[0]
		print(params[1] * factor, params[2] * factor)

def extended_euclidean(m, n):
	(r0, r1) = (m, n)
	(x0, x1) = (1, 0)
	(y0, y1) = (0, 1)
	while r1 != 0:
		q = r0 // r1
		(r0, r1) = (r1, r0 - r1 * q)
		(x0, x1) = (x1, x0 - x1 * q)
		(y0, y1) = (y1, y0 - y1 * q)
	return (r0, x0, y0)
solve()


def rec(a, b):
	if a == 0:
		return (0, 1, b)
	(x, y, s) = rec(b % a, a)
	return (y - b // a * x, x, s)
(x, y, z) = map(int, input().split())
(a, b, s) = rec(x, y)
if z % s != 0:
	print(-1)
	exit(0)
a *= -z // s
b *= -z // s
print(a, b)


vals = input().split()
(A, B, C) = (int(vals[0]), int(vals[1]), int(vals[2]))
max_num = int(5e+18)

def gcd_extended(a, b):
	r = a % b
	if r == 0:
		return (b, 0, 1)
	else:
		(g, x, y) = gcd_extended(b, r)
		return (g, y, x - a // b * y)
if A == 0:
	if C % B == 0:
		print(0, -C // B)
	else:
		print(-1)
elif B == 0:
	if C % A == 0:
		print(-C // A, 0)
	else:
		print(-1)
else:
	(g, x, y) = gcd_extended(A, B)
	if C % g == 0:
		k = C // g
		kx = -k * x
		ky = -k * y
		if abs(kx) > max_num or abs(ky) > max_num:
			print(-1)
		else:
			print(kx, ky)
	else:
		print(-1)


import math

def ii():
	return int(input())

def ill():
	return input().split(' ')

def ili():
	return [int(i) for i in input().split(' ')]

def ilis():
	return (int(i) for i in input().split(' '))

def gcd(a, b):
	return a if b == 0 else gcd(b, a % b)

def extgcd(a, b, x=0, y=0):
	if b == 0:
		return (a, 1, 0)
	(d, m, n) = extgcd(b, a % b, x, y)
	return (d, n, m - a // b * n)

def main():
	(a, b, c) = ilis()
	(d, x, y) = extgcd(abs(a), abs(b))
	if abs(c) % d == 0:
		x *= -c // d
		y *= -c // d
		if a < 0:
			x = -x
		if b < 0:
			y = -y
		print(x, y)
		return
	else:
		print(-1)
		return
main()


import math
(a, b, c) = [int(x) for x in input().split()]
(a1, b1) = (abs(a), abs(b))
(xa, ya, xb, yb) = (math.copysign(1, a), 0, 0, math.copysign(1, b))
if a1 < b1:
	(a1, b1) = (b1, a1)
	(xa, ya, xb, yb) = (xb, yb, xa, ya)
while b1 > 0:
	k = a1 // b1
	(xa, ya, xb, yb) = (xb, yb, xa - k * xb, ya - k * yb)
	(a1, b1) = (b1, a1 % b1)
nod = int(a1)
if c % nod != 0:
	print(-1)
else:
	(x, y) = (-int(xa) * int(c // nod), -int(ya) * int(c // nod))
	print(x, y)


from math import *
(a, b, c) = list(map(int, input().split()))
if b == 0:
	if c % a == 0:
		print(round(-c / a), 0)
	else:
		print(-1)
elif a == 0:
	if c % b == 0:
		print(0, round(-c / b))
	else:
		print(-1)
elif c % gcd(a, b) != 0:
	print(-1)
elif abs(a) == abs(b):
	x = 0
	y = (-c - a * x) / b
	y = round(y)
	print(x, y)
elif abs(b) > abs(a):
	z = [abs(b), abs(a)]
	c1 = abs(c)
	if a >= 0 and b < 0 or (a < 0 and b >= 0):
		if c >= 0 and a < 0 or (c < 0 and a >= 0):
			v = [c1, -(c1 % abs(a))]
			h = 2
		else:
			v = [-c1, c1 % abs(a)]
			h = 3
	elif c >= 0 and a >= 0 or (c < 0 and a < 0):
		v = [-c1, -(c1 % abs(a))]
		h = -1
	else:
		v = [c1, c1 % abs(a)]
		h = 1
	i = 2
	c1 %= abs(a)
	while z[-2] % z[-1] > 1:
		z.append(z[-2] % z[-1])
		i += 1
		c1 %= abs(z[-1])
		if h == 2:
			v.append(c1 * (-1) ** (i + 1))
		elif h == 3:
			v.append(c1 * (-1) ** i)
		else:
			v.append(h * c1)
	if h == -1 or h == 1:
		for j in range(i):
			z[j] = -z[j]
	x = v[-1]
	for j in range(i - 2, -1, -1):
		x = (x * z[j] + v[j]) // abs(z[j + 1])
	y = (-c - a * x) // b
	print(x, y)
else:
	w = a
	a = b
	b = w
	z = [abs(b), abs(a)]
	c1 = abs(c)
	if a >= 0 and b < 0 or (a < 0 and b >= 0):
		if c >= 0 and a < 0 or (c < 0 and a >= 0):
			v = [c1, -(c1 % abs(a))]
			h = 2
		else:
			v = [-c1, c1 % abs(a)]
			h = 3
	elif c >= 0 and a >= 0 or (c < 0 and a < 0):
		v = [-c1, -(c1 % abs(a))]
		h = -1
	else:
		v = [c1, c1 % abs(a)]
		h = 1
	i = 2
	c1 %= abs(a)
	while z[-2] % z[-1] > 1:
		z.append(z[-2] % z[-1])
		i += 1
		c1 %= abs(z[-1])
		if h == 2:
			v.append(c1 * (-1) ** (i + 1))
		elif h == 3:
			v.append(c1 * (-1) ** i)
		else:
			v.append(h * c1)
	if h == -1 or h == 1:
		for j in range(i):
			z[j] = -z[j]
	x = v[-1]
	for j in range(i - 2, -1, -1):
		x = (x * z[j] + v[j]) // abs(z[j + 1])
	y = (-c - a * x) // b
	print(y, x)


import math

def ext_gcd(a, b):
	if b == 0:
		return (a > 0 and 1 or -1, 0)
	(x, y) = ext_gcd(b, a % b)
	return (y, x - a // b * y)
(A, B, C) = map(int, input().split())
C = -C
(a2, a3) = ext_gcd(A, B)
t = math.gcd(A, B)
if C % t != 0:
	print(-1)
else:
	print(a2 * C // t, a3 * C // t)


import sys, math
I = sys.stdin.readline
(a, b, c) = map(int, I().split())

def extendedGcd(a, b):
	if b == 0:
		return (a, 1, 0)
	(g, x1, y1) = extendedGcd(b, a % b)
	x = y1
	y = x1 - a // b * y1
	return (g, x, y)
if c % math.gcd(a, b):
	print(-1)
else:
	(d, x, y) = extendedGcd(a, b)
	print(x * (-c // d), y * (-c // d))


(A, B, C) = map(int, input().split())

def GCD(A, B):
	r = 1
	if B == 0:
		id_ = B
		B = A
		A = id_
	elif A < B and A != 0:
		id_ = B
		B = A
		A = id_
	while r is not 0:
		r = A % B
		A = B
		B = r
		if r == 0:
			break
	return A
if A < 0:
	a = -1
else:
	a = 1
if B < 0:
	b = -1
else:
	b = 1
gcd = GCD(abs(A), abs(B))
if B == 0:
	id_ = B
	B = A
	A = id_
r = C % gcd
if r != 0:
	print(-1)
else:
	u = 1
	U = 0
	v = 0
	V = 1
	R = 1
	while R is not 0:
		R = abs(A) % abs(B)
		if R == 0:
			break
		q = abs(A) // abs(B)
		A = B
		B = R
		id_ = U
		U = u - q * U
		u = id_
		id_ = V
		V = v - q * V
		v = id_
	print(-C * a * U // gcd, -C * b * V // gcd)


import os
import sys
from io import BytesIO, IOBase
import math
from decimal import *
from collections import defaultdict, deque
import heapq
getcontext().prec = 25
abcd = 'abcdefghijklmnopqrstuvwxyz'
MOD = pow(10, 9) + 7
BUFSIZE = 8192
from bisect import bisect_left, bisect_right

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def extended_gcd(a, b):
	(x, y) = (1, 0)
	(x1, y1) = (0, 1)
	(a1, b1) = (a, b)
	while b1:
		q = a1 // b1
		(x, x1) = (x1, x - q * x1)
		(y, y1) = (y1, y - q * y1)
		(a1, b1) = (b1, a1 - q * b1)
	return (x, y, a1)
(a, b, c) = map(int, input().split(' '))
(x, y, g) = extended_gcd(a, b)
if c % g:
	print(-1)
else:
	print(x * (c // g) * -1, y * (c // g) * -1)


(a, b, c) = input().split(' ')
(a, b, c) = (int(a), int(b), int(c))
from math import trunc

def gcdex(a, b):
	if b == 0:
		return (a, 1, 0)
	else:
		(d, x, y) = gcdex(b, a % b)
		return (d, y, x - y * (a // b))

def main():
	(g, x0, y0) = gcdex(a, b)
	if c % g != 0:
		print(-1)
		return
	x = -x0 * int(c / g)
	y = -y0 * int(c / g)
	print(x, y)
main()


def compute():

	def xgcd(b, n):
		(x0, x1, y0, y1) = (1, 0, 0, 1)
		while n != 0:
			(q, b, n) = (b // n, n, b % n)
			(x0, x1) = (x1, x0 - q * x1)
			(y0, y1) = (y1, y0 - q * y1)
		return (b, x0, y0)
	(A, B, C) = map(int, input().split())
	if A == 0 and B == 0:
		return [-1] if C != 0 else [0, 0]
	if A == 0:
		return [0, -C // B] if abs(-C) % B == 0 else [-1]
	if B == 0:
		return [-C // A, 0] if abs(-C) % A == 0 else [-1]
	(g, x, y) = xgcd(A, B)
	if abs(-C) % g != 0:
		return [-1]
	d = -C // g
	return [x * d, y * d]
print(' '.join((str(it) for it in compute())))


def eu(a, b, t):
	if a == t:
		return (1, 0)
	if b == t:
		return (0, 1)
	if a == 0:
		return (0, t // b)
	if b == 0:
		return (t // a, 0)
	if a > 0:
		sa = 1
	else:
		sa = -1
	if b > 0:
		sb = 1
	else:
		sb = -1
	(a, b) = (abs(a), abs(b))
	if a > b:
		(x, y) = eu(a % b, b, t)
		return (sa * x, sb * (y - a // b * x))
	(x, y) = eu(a, b % a, t)
	return (sa * (x - b // a * y), sb * y)
from math import gcd
(a, b, c) = [int(i) for i in input().split()]
t = gcd(a, b)
if c % t:
	print(-1)
else:
	(x, y) = eu(a, b, gcd(a, b))
	print(-x * c // t, -y * c // t)


import logging
logging.basicConfig(level=logging.INFO)

def readGenerator(transform):
	while True:
		n = 0
		tmp = tuple(map(lambda x: transform(x), input().split()))
		m = len(tmp)
		while n < m:
			yield tmp[n]
			n += 1
readint = readGenerator(lambda x: int(x))
(A, B, C) = (next(readint), next(readint), next(readint))

def exGCD(x, y):
	if y == 0:
		return [x, 1, 0]
	tmp = exGCD(y, x % y)
	return [tmp[0], tmp[2], tmp[1] - x // y * tmp[2]]

def solve(L, R, q):
	if q < 0:
		return solve(-R, -L, -q)
	b = R // q
	a = -(-L // q)
	return [a, b]
L = int(5 * 1e+18)

def work(A, B, C):
	tmp = exGCD(A, B)
	(d, u, v) = (tmp[0], tmp[1], tmp[2])
	p = A // d
	q = B // d
	if C % d != 0:
		print(-1)
		return 0
	x0 = -u * C // d
	y0 = -v * C // d
	(rx, ry) = ([], [])
	if q != 0:
		rx = solve(-L - x0, L - x0, q)
	if p != 0:
		ry = solve(y0 - L, L + y0, p)
	if p == 0:
		n = rx[0]
	elif q == 0:
		n = ry[0]
	else:
		a = max(rx[0], ry[0])
		b = min(rx[1], ry[1])
		if a > b:
			print(-1)
			return 0
		n = a
	x = x0 + n * q
	y = y0 - n * p
	print(x, y)
	return 1
work(A, B, C)


def xgcd(b, a):
	(x0, x1, y0, y1) = (1, 0, 0, 1)
	while a != 0:
		(q, b, a) = (b // a, a, b % a)
		(x0, x1) = (x1, x0 - q * x1)
		(y0, y1) = (y1, y0 - q * y1)
	return (b, x0, y0)
(a, b, c) = map(int, input().split())
(g, x, y) = xgcd(a, b)
if c % g == 0:
	q = -c // g
	print(x * q, y * q)
else:
	print(-1)


from math import gcd

def evc(a, b):
	if a == 0:
		return [0, 1, b]
	(x, y, g) = evc(b % a, a)
	return [y - b // a * x, x, g]
(a, b, c) = map(int, input().split())
cur = evc(a, b)
if c % cur[2]:
	print(-1)
else:
	k = -c // cur[2]
	print(cur[0] * k, cur[1] * k)


def egcd(a, b):
	if b == 0:
		return (a, 1, 0)
	(d, x, y) = egcd(b, a % b)
	return (d, y, x - y * (a // b))
(a, b, c) = map(int, input().split())
(d, x, y) = egcd(abs(a), abs(b))
if c % d != 0:
	print(-1)
	exit()
a //= d
b //= d
c //= d
if a < 0:
	x = -x
if b < 0:
	y = -y
x *= -c
y *= -c
print(x, y)


import sys

def Bezout_identity(a, b):
	r = b
	(x, x1) = (1, 0)
	(y, y1) = (0, 1)
	while r:
		(q, r) = divmod(a, b)
		(a, b) = (b, r)
		(x, x1) = (x1, x - x1 * q)
		(y, y1) = (y1, y - y1 * q)
	return (a, x, y)

def main():
	(a, b, c) = map(int, sys.stdin.readline().strip().split())
	(gcd_a_b, bezout_x, bezout_y) = Bezout_identity(a, b)
	if c % gcd_a_b:
		sys.stdout.write('-1' + '\n')
	else:
		d = -c // gcd_a_b
		sys.stdout.write(str(bezout_x * d) + ' ' + str(bezout_y * d) + '\n')
main()


def f(a, b):
	if not b:
		return (a, 1, 0)
	(c, x, y) = f(b, a % b)
	return (c, y, x - a // b * y)
(a, b, c) = map(int, input().split())
(k, x, y) = f(a, b)
if c % k:
	print(-1)
else:
	c = -c // k
	print(x * c, y * c)


def bezout(a, b):
	(u, v, s, t) = (1, 0, 0, 1)
	while b != 0:
		(q, r) = [(a - a % b) // b, a % b]
		(a, b) = (b, r)
		(u, s) = (s, u - q * s)
		(v, t) = (t, v - q * t)
	return [u, v, a]

def gcd(a, b):
	if a < 0:
		a = -a
	if b < 0:
		b = -b
	if a == 0:
		return b
	while b != 0:
		(a, b) = (b, a % b)
	return a
[a, b, c] = list(map(int, input().split()))
g = gcd(a, b)
if c % g == 0:
	(a, b, c) = (a // g, b // g, -c // g)
	ans = bezout(a, b)
	print(str(ans[0] * c * ans[2]) + ' ' + str(ans[1] * c * ans[2]))
else:
	print(-1)