import sys
import math
# Fast input
input = sys.stdin.readline
# Fast output
def print(*args, **kwargs):
sep = kwargs.get('sep', ' ')
end = kwargs.get('end', '\n')
file = kwargs.get('file', sys.stdout)
flush = kwargs.get('flush', False)
output = sep.join(map(str, args)) + end
file.write(output)
if flush:
file.flush()
from types import GeneratorType
def bootstrap(f, stack=[]):
def wrappedfunc(*args, **kwargs):
if stack:
return f(*args, **kwargs)
else:
to = f(*args, **kwargs)
while True:
if type(to) is GeneratorType:
stack.append(to)
to = next(to)
else:
stack.pop()
if not stack:
break
to = stack[-1].send(to)
return to
return wrappedfunc
# @bootstrap
# def dfs(node, parent, x):
# sx = 1
# for i in graph[node]:
# if i==parent:
# continue
# sx += yield dfs(i, node, x)
# if sx >= x:
# ans[0] += 1
# sx = 0
# yield sx
from collections import Counter, deque, defaultdict
from itertools import accumulate, product, groupby, combinations
import operator
import math
import bisect
import heapq
def readIntLine():
return [int(char) for char in input().split()]
def readCharLine():
return [char for char in input().split()]
def modmul(a, b, mod):
a %= mod
b %= mod
return (a * b) % mod
def modadd(a, b, mod):
a %= mod
b %= mod
return (a+b)%mod
def modsub(a, b, mod):
a %= mod
b %= mod
return (a - b + mod)%mod
def modInverse(A, M):
for X in range(1, M):
if (((A % M) * (X % M)) % M == 1):
return X
return -1
def gcd(a,b):
if b== 0:
return a
return gcd(b, a%b)
def is_coprime(a,b):
return gcd(a,b)==1
def expo(a, n, mod):
res = 1
while n:
if n&1:
res = modmul(res,a,mod)
n -= 1
else:
a = modmul(a,a,mod)
n >>= 1
return res
def get_mex(arr, N):
arr = sorted(arr)
mex = 0
for idx in range(N):
if arr[idx] == mex:
mex += 1
return mex
def solve():
# n = int(input())
a, b, C = map(int,input().split())
# s = input().rstrip('\n')
# A = readIntLine()
# B = readIntLine()
# MOD = 1000000007
a_one, b_one = a, b
A, B = [], []
indices = []
for i in range(63):
x = (1<<i)
if x&C:
if a_one>b_one:
A.append(1)
B.append(0)
a_one -= 1
else:
A.append(0)
B.append(1)
b_one -= 1
else:
A.append(0)
B.append(0)
indices.append(i)
# these are indices where C is zero
for i in indices:
if a_one and b_one:
A[i] = 1
B[i] = 1
a_one -= 1
b_one -= 1
if a_one and not b_one:
print(-1)
return
if b_one and not a_one:
print(-1)
return
# A.reverse()
# B.reverse()
# print(A)
# print(B)
ans_a = 0
ans_b = 0
for i in range(63):
if A[i]:
ans_a += (1<<i)
if B[i]:
ans_b += (1<<i)
if ans_a ^ ans_b == C:
print(ans_a, ans_b)
else:
print(-1)
# n, a, b = map(int,input().split())
# A = readIntLine()
# t = a+b
# arr = [x%t for x in A]
# mn, mx = min(arr), max(arr)
# if mx-mn < a:
# print("Yes")
# else:
# print("No")
# intervals = []
# for x in arr:
# l = 1-x
# r = a-x
# l = (l+t)%t
# r = (r+t)%t
# intervals.append([l,r])
# print(intervals)
# intervals.sort()
# stack = []
# for start, end in intervals:
# if not stack:
# stack.append([start, end])
# continue
# prev_start, prev_end = stack[-1]
# if start > prev_end:
# print("No")
# return
# stack[-1][0] = max(stack[-1][0], start)
# print("Yes")
solve()
# for i in range(int(input())):
# solve()