a,b,k=list(map(int,input().split()))

c=0

while True:

    if a%2:a-=1

    b+=a//2

    a//=2

    c+=1

    if c==k:break

    if b%2:b-=1

    a+=b//2

    b//=2

    c+=1

    if c==k:break

print((a,b))
a,b,k=list(map(int,input().split()))

for i in range(k):

 if i%2<1:b+=a//2;a//=2

 else:a+=b//2;b//=2

print((a,b))
a, b, k = list(map(int, input().split()))
c = 0
while True:
    if a % 2:
        a -= 1
    b += a // 2
    a //= 2
    c += 1
    if c == k:
        break
    if b % 2:
        b -= 1
    a += b // 2
    b //= 2
    c += 1
    if c == k:
        break
print((a, b))

a, b, k = list(map(int, input().split()))
for i in range(k):
    if i % 2 < 1:
        b += a // 2
        a //= 2
    else:
        a += b // 2
        b //= 2
print((a, b))

-c = 0 -while True: -    if a % 2: -        a -= 1 -    b += a // 2 -    a //= 2 -    c += 1 -    if c == k: -        break -    if b % 2: -        b -= 1 -    a += b // 2 -    b //= 2 -    c += 1 -    if c == k: -        break +for i in range(k): +    if i % 2 < 1: +        b += a // 2 +        a //= 2 +    else: +        a += b // 2 +        b //= 2