Problem:
 Score : 200 points    Problem Statement In the beginning, Takahashi has A cookies, and Aoki has B cookies.
They will perform the following operation alternately, starting from Takahashi:   If the number of cookies in his hand is odd, eat one of those cookies; if the number is even, do nothing. Then, give one-half of the cookies in his hand to the other person.   Find the numbers of cookies Takahashi and Aoki respectively have after performing K operations in total.      Constraints  1 \leq A,B \leq 10^9  1 \leq K \leq 100  A,B and K are integers.         Input Input is given from Standard Input in the following format:  A  B  K       Output Print the number of cookies Takahashi has, and the number of cookies Aoki has, in this order, after performing K operations in total.        Sample Input 1 5 4 2      Sample Output 1 5 3  The process will go as follows:   In the beginning, Takahashi and Aoki have 5 and 4 cookies, respectively.  Takahashi eats one cookie and gives two cookies to Aoki. They now have 2 and 6 cookies, respectively.  Aoki gives three cookies to Takahashi. They now have 5 and 3 cookies, respectively.        Sample Input 2 3 3 3      Sample Output 2 1 3       Sample Input 3 314159265 358979323 84      Sample Output 3 448759046 224379523

Solution (Python):
A, B, K = map(int, input().split())

for i in range(K):
  if i%2 == 0:
    B += A // 2
    A //= 2
  else:
    A +=  B//2
    B //= 2

print("{} {}".format(A,B))

Solution (Python):
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    A,B,K=MI()
    
    for i in range(K):
        if i%2==0:
            A=A//2
            B+=A
        else:
            B=B//2
            A+=B
            
    print(A,B)

main()

Solution (Python):
if __name__ == '__main__':
    a = [int(i) for i in input().split()]
    flag = 0
    for i in range(a[2]):
        count=0
        if flag == 0:
            if a[0] %2 ==1:
                a[0]-=1
            a[0]=a[0]//2
            a[1]+=a[0]
            flag=1
        else:
            if a[1] %2 ==1:
                a[1]-=1
            a[1]=a[1]//2
            a[0]+=a[1]
            flag=0
    print(str(a[0])+" "+str(a[1]))

Solution (Python):
a,b,k = map(int, input().split())

for _ in range(k//2):
    if a%2: a-=1
    b += a//2
    a -= a//2

    if b%2: b-=1
    a += b//2
    b -= b//2

if k%2:
    if a%2: a-=1
    b += a//2
    a -= a//2
    


print(a,b)

Solution (Python):
a, b, k = map(int, input().split())

flg = 1

for i in range(k):
    if flg == 1:
        if a % 2 == 0:
            b += a // 2
            a /= 2
        else:
            a -= 1
            b += a // 2
            a /= 2
    elif flg == -1:
        if b % 2 == 0:
            a += b // 2
            b /= 2
        else:
            b -= 1
            a += b // 2
            b /= 2
    flg *= -1

print(int(a), int(b))

Solution (Python):
A, B, K = map(int, input().split())
for i in range(1, K+1):
  if(i%2==1):
    if(A%2 == 1):
      A = A-1
    B += A//2
    A = A//2
  else:
    if(B%2 == 1):
      B = B-1
    A += B//2
    B = B//2
print(A, B)

Solution (Python):
a,b,k = map(int,input().split())

for i in range(k):
    if i % 2 == 0:
        if a % 2 == 0:
            pass
        else:
            a = a - 1
        b = b + (a // 2)
        a = a // 2
    else:
        if b % 2 == 0:
            pass
        else:
            b = b - 1
        a = a + (b // 2)
        b = b // 2

print(a,b)

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

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, K = MAP()

for i in range(K):
	B += A//2
	A //= 2

	A, B = B, A

if K%2 == 1:
	A, B = B, A
print(A, B)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, K = MAP()

for i in range(K):
	if A%2 == 1:
		A -= 1
	B += A//2
	A //= 2

	A, B = B, A

if K%2 == 1:
	A, B = B, A
print(A, B)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




A,B,K = IL()

for i in range(K):
  if i%2==0:
    A,B = A//2,B+A//2
  else:
    A,B = A+B//2,B//2
print(A,B)

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

Solution (Python):
a,b,k=map(int,input().split())
for i in range(k):
  if i % 2 == 0:
    give = a//2
    a = a//2
    b += give
  else:
    give = b//2
    b = b//2
    a += give
print(a,b)

Solution (Python):
a, b, k = map(int,input().split())

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

print(a,b)

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

Solution (Python):
a,b,k=map(int,input().split())
for x in range(k):
    if x%2==0:
        a=a//2
        b+=a
    else:
        b=b//2
        a+=b
print(a,b)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,k=map(int,input().split())
    for i in range(k):
        if i%2==0:
            a=a//2*2
            b+=a//2
            a=a//2
        else:
            b=b//2*2
            a+=b//2
            b=b//2           
    print(a,b)

if __name__=='__main__':
    main()

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

Solution (Python):
a, b, k = map(int, input().split())
for i in range(k):
    if i % 2 == 0:
        a -= a % 2
        b += a // 2
        a //= 2
    else:
        b -= b % 2
        a += b // 2
        b //= 2
print(a, b)

Solution (Python):
a,b,k = map(int,input().split())
i = 0
while i < k:
  if a%2 == 1:
    a -= 1 
  a = a//2
  b += a
    
  if k-i == 1:
    break
  if b%2 == 1:
    b -= 1 
  b = b//2
  a += b
  i += 2
print(a,b)

Solution (Python):
A,B,K=map(int,input().split())
for k in range(K):
    if k%2==0:
        A//=2
        B+=A
    if k%2==1:
        B//=2
        A+=B
print(A,B)

Solution (Python):
A,B,K=map(int,input().split())
for k in range(K):
    if k%2==0:
        if A%2==1:
            A-=1
        A//=2
        B+=A
    if k%2==1:
        if B%2==1:
            B-=1
        B//=2
        A+=B
print(A,B)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, k = map(int, input().split())

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

    print(a, b)


if __name__ == '__main__':
    resolve()

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, k = map(int, input().split())

    def calc(a, b):
        if a % 2:
            a -= 1
            b += a // 2
            a //= 2
        else:
            b += a // 2
            a //= 2

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

    print(a, b)


if __name__ == '__main__':
    resolve()

Solution (Python):
a,b,k = map(int,input().split())
cnt = 0
for i in range(k):
    if cnt%2 == 0:
        if a % 2 != 0:
            a -= 1
        a = a//2
        b += a
    else:
        if b % 2 != 0:
            b -= 1
        b = b//2
        a += b
    cnt +=1
print(a,b)

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

Solution (Python):
from sys import stdin
import math
import re
import queue

input = stdin.readline

MOD = 1000000007

def solve():
    A,B,K = map(int, input().split())
    turn = 0
    while K > 0:
        if turn == 0:
            if A%2 == 1:
                A -= 1
            B += A/2
            A /= 2
            turn ^= 1
        else :
            if B%2 == 1:
                B -=1
            A += B/2
            B /= 2
            turn ^= 1
        K -= 1

    A = (int)(A)
    B = (int)(B)
    print(A,B)
            


        

if __name__ == '__main__':
    solve()

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

Solution (Python):
A,B,K = list(map(int,input().split()))
for i in range(K):
    if i % 2 == 0:
        if A % 2 != 0:
            A -= 1
        A //=2
        B += A
    else:
        if B % 2 != 0:
            B -= 1
        B //=2
        A += B
print(str(A)+' '+str(B))

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

Solution (Python):
a,b,k = map(int,input().split())

for i in range(k):
    if i%2==0:
        if a%2!=0:
            a-=1
        a,b = a//2,a//2+b
    if i%2!=0:
        if b%2!=0:
            b-=1
        a,b = a+b//2,b//2

print(a,b)

Solution (Python):
A, B, K = map(int,input().split())

for k in range(K):
    if k%2 == 0:
        if A%2 == 1:
            A -= 1
        A //= 2
        B += A
    else:
        if B%2 == 1:
            B -= 1
        B //= 2
        A += B
print(A,B)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    A, B, K = map(int, input().split())

    for i in range(K):
        if i % 2 == 0:
            if A % 2 == 1:
                A -= 1
            B += A // 2
            A //= 2
        else:
            if B % 2 == 1:
                B -= 1
            A += B // 2
            B //= 2

    print(f"{A} {B}")


if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    a,b,k=map(int,input().split())
    for i in range(k):
        if i%2==0:
            val=a//2
            a=val
            b+=val
        else:
            val=b//2
            b=val
            a+=val
    print(a,b)


    
resolve()

Solution (Python):
a,b,k = map(int,input().split())

for i in range(k):
    a -= a%2
    b += a//2
    a -= a//2
    a,b = b,a
if(k%2 == 1):
  a,b = b,a
print(a,b)

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

Solution (Python):


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

for i in range(K):
    if i % 2 == 0:
        if a % 2 != 0:
            a -= 1
        b += a // 2
        a //= 2
    else:
        if b % 2 != 0:
            b -= 1
        a += b // 2
        b //= 2

print(a,b)

Solution (Python):
a,b,k = map(int,input().split())

for i in range(k):
    a -= a%2
    b += a//2
    a -= a//2
    a,b = b,a
if(k%2 == 1):a,b = b,a
print(a,b)

Solution (Python):
A,B,K=map(int,input().split())
while True:
    if A%2==1:
        A-=1
    K-=1
    B+=A//2
    A//=2
    if K==0: break
    if B%2==1:
        B-=1
    A+=B//2
    B//=2
    K-=1
    if K==0: break
    
print(A,B)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline

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

print(a,b)

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

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

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

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

Solution (Python):
a, b, K = map(int, input().split())

for i in range(K):
    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        b += a // 2
        a //= 2
    else:
        if b % 2 == 1:
            b -= 1

        a += b // 2
        b //= 2

print(a, b)

Solution (Python):
a,b,k=map(int, input().split())
turn=0
for i in range(k):
    if turn==0:
        if a%2!=0:
            a-=1
        b+=a//2
        a=a//2
        turn=1
    else:
        if b%2!=0:
            b-=1
        a+=b//2
        b=b//2
        turn=0
print(a,b)

Solution (Python):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

    a,b,k = map(int, input().split())
    turn = 0
    while k > 0:
        k -= 1
        if turn == 0:
            if a%2 == 1:
                a -= 1
            a //= 2
            b += a
        else:
            if b%2 == 1:
                b -= 1
            b //= 2
            a += b
        turn ^= 1
    print(a, b)

if __name__ == '__main__':
    main()

Solution (Python):
a,b,k=map(int,input().split())
flag=0
for i in range(k):
    if flag==0:
        if a%2!=0:
            a-=1
        b+=a//2
        a=a//2
        flag=1
    else:
        if b%2!=0:
            b-=1
        a+=b//2
        b=b//2
        flag=0
print(a,b)

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,k=map(int,input().split())
    for i in range(k):
        if i%2==0:
            a=a//2*2
            b+=a//2
            a=a//2
        else:
            b=b//2*2
            a+=b//2
            b=b//2           
    print(a,b)

if __name__=='__main__':
    main()

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

Solution (Python):
A, B, K = map(int, input().split())

cnt = 0
for i in range(K):
    if i % 2 == 0:
        if A % 2 != 0:
            A = (A-1) // 2
        else:
            A //= 2
        B += A

    else:
        if B % 2 != 0:
            B = (B-1) // 2
        else:
            B //= 2
        A += B

    cnt += 1

print(A, B)

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

Solution (Python):
A, B, K = map(int,input().split())
for i in range(K):
  if i % 2 == 0:
    if A % 2 == 1: A -= 1
    A //= 2
    B += A
  else:
    if B % 2 == 1: B -= 1
    B //= 2
    A += B
print(A, B)

Solution (Python):
from sys import stdin
A, B, K = [int(_) for _ in stdin.readline().rstrip().split()]
for i in range(K):
  if i % 2 == 0:
    B += A // 2
    A //= 2
  else:
    A += B // 2
    B //= 2
print(A, B)

Solution (Python):
A, B, K = map(int, input().split())
C = [A, B]
for i in range(K):
    if C[i&1] & 1:
        C[i&1] -= 1
    C[i&1] >>= 1
    C[(i&1)^1] += C[i&1]
print(*C)

Solution (Python):
a, b, k = map(int, input().split())

for i in range(k):
    if i % 2 == 0:
        b += a // 2
        a //= 2
    else:
        a += b // 2
        b //= 2

print(a, b)

Solution (Python):
A, B, K = map(int, input().split())

for i in range(K):
    if i%2==0:
        if A%2==1:
            A -= 1
        tmp = A//2
        A //= 2
        B += tmp
    else:
        if B%2==1:
            B -= 1
        tmp = B//2
        B //= 2
        A += tmp

print(A, B)

Solution (Python):
A,B,K=map(int,input().split())
for a in range(K):
  if a%2==0:
    A=A//2
    B+=A
  else:
    B=B//2
    A+=B
print(A,B)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def S(): return input().rstrip()
def LS(): return S().split()
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10


def solve():
    a, b, k = LI()
    for i in range(k):
        if i & 1:
            b = b // 2
            a += b
        else:
            a = a // 2
            b += a
    print(a,b)
    return



if __name__ == '__main__':
    solve()

Solution (Python):
A, B, K = map(int, input().split())

for i in range(K):
    if i % 2 == 0:
        
        if A%2 == 0:
            tmp = A//2
            A //= 2
            B += tmp
        else:
            A -= 1
            tmp = A//2
            A //= 2
            B += tmp
    else:
        
        if B%2 == 0:
            tmp = B//2
            B //= 2
            A += tmp
        else:
            B -= 1
            tmp = B//2
            B //= 2
            A += tmp
print(A, B)

Solution (Python):
a, b, k = map(int, input().split())

for i in range(k):
    if i % 2:
        a += b // 2
        b //= 2
    else:
        b += a // 2
        a //= 2

print(a, b)

Solution (Python):
t,a,k=list(map(int,input().split()))
i=0
while True:
    if t%2==1:
        t-=1
    a+=t//2
    t-=t//2
    i+=1
    if i>=k:
        break
    if a%2==1:
        a-=1
    t+=a//2
    a-=a//2
    i+=1
    if i>=k:
        break

print(t,a)

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

a,b,k = iim()

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

print(a,b)

Solution (Python):
a, b, k = map(int, input().split())

for i in range(k):
    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        t = a//2
        a = t
        b += t
    else:
        if b % 2 == 1:
            b -= 1
        t = b//2
        b = t
        a += t
print(a, b)

Solution (Python):
a,b,k=map(int,input().split())

for i in range(k):
    if i%2==0:
        if a%2!=0:
            a-=1
        a//=2
        b+=a
    else:
        if b%2!=0:
            b-=1
        b//=2
        a+=b
print(a,b)

Solution (Python):

def inputlist(): return [int(j) for j in input().split()]
from collections import Counter


A,B,K = inputlist()
count = 0
while True:
    if A % 2 == 1:
        A -=1
    d = A//2
    B += d
    A -=d
    count +=1
    if count == K:
        break
    if B % 2 == 1:
        B-=1
    da = B//2
    A += da
    B -=da
    count +=1
    if count == K:
        break
print(A,B)

Solution (Python):
def change(x,y):
  if x%2==1:
    x-=1
  x=x//2
  y+=x
  return x,y
a,b,k=map(int,input().split())
for i in range(k):
  if i%2==0:
    a,b=change(a,b)
  else:
    b,a=change(b,a)
print(a,b)

Solution (Python):
a,b,k=map(int,input().split())
w=0
for i in range(k):
    if i%2==0:
        w=a//2
        a=w
        b+=w
    else:
        w=b//2
        a+=w
        b=w
print(a,b)

Solution (Python):
a,b,k=map(int,input().split())

while k>0:
  if a%2==0:
    b+=a/2
    a-=a/2
  else:
    a-=1
    b+=a/2
    a-=a/2
  
  k-=1
  if k==0:
    break
    
  if b%2==0:
    a+=b/2
    b-=b/2
  else:
    b-=1
    a+=b/2
    b-=b/2
    
  k-=1
  
print(int(a),int(b))

Solution (Python):
A, B, K = map(int, input().split())
for i in range(K):
    if i % 2: A, B = A+B//2, B//2
    else: A, B = A//2, A//2+B
print(A, B)

Solution (Python):

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

for i in range(k):
    if i%2==0:
        if a%2==1:
            a=max(a-1,0)
        b+=(a//2)
        a//=2
    else:
        if b%2==1:
            b=max(b-1,0)
        a+=(b//2)
        b//=2
print(a,b)

Solution (Python):
def main():

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

    print(a,b)



if __name__ == '__main__':
    main()

Solution (Python):
A,B,K=map(int,input().split())
for i in range(K):
	if i%2==0:
		if A%2==1:
			A-=1
		A=A//2
		B+=A
	else:
		if B%2==1:
			B-=1
		B=B//2
		A+=B
print(A,end=" ")
print(B)

Solution (Python):
a,b,k=map(int,input().split())

for i in range(k):
    if i%2==0:
        if a%2==1:
            a=max(a-1,0)
        b+=(a//2)
        a//=2
    else:
        if b%2==1:
            b=max(b-1,0)
        a+=(b//2)
        b//=2
print(a,b)

Solution (Python):
def main():
    takahashi_cookie, aoki_cookie, operation = map(int, input().split())
    for i in range(operation):
        if i % 2 == 0:
            if takahashi_cookie % 2:
                takahashi_cookie -= 1
            aoki_cookie += takahashi_cookie // 2
            takahashi_cookie //= 2
        else:
            if aoki_cookie % 2:
                aoki_cookie -= 1
            takahashi_cookie += aoki_cookie // 2
            aoki_cookie //= 2
    print(takahashi_cookie, aoki_cookie)


if __name__ == '__main__':
    main()

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

Solution (Python):
a, b, k = map(int, input().split())

for i in range(k):
    if i%2:
        b //= 2
        a += b
    else:
        a //= 2
        b += a
print(a, b)

Solution (Python):
A, B, K = map(int, input().split())

for i in range(K):
  if i % 2 == 0:
    if A % 2 != 0:
      A -= 1
    B += A // 2
    A = A // 2
  else:
    if B % 2 != 0:
      B -= 1
    A += B // 2
    B = B // 2
print(A, B)

Solution (Python):
a, b, k = map(int, input().split())
ab = [a, b]
turn = 1
for _ in range(k):
  turn = not turn
  if ab[turn] % 2 == 1:
    ab[turn] -= 1
  ab[turn] //= 2
  ab[not turn] += ab[turn]
print(*ab)

Solution (Python):
def main():
    a, b, c = (int(i) for i in input().split())
    for k in range(c):
        if k % 2 == 0:
            b += a//2
            a //= 2
        else:
            a += b//2
            b //= 2
    print(a, b)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
def solve():
    A, B, K = map(int, input().split())
    for i in range(K):
        if i % 2 == 0:
            if A % 2 == 1: A -= 1
            A //= 2
            B += A
        else:
            if B % 2 == 1: B -= 1
            B //= 2
            A += B
    print(A, B)

    return 0

if __name__ == "__main__":
    solve()

Solution (Python):


import sys
stdin = sys.stdin

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    a, b, k = na()
    for i in range(k):
        b += a//2
        a //= 2
        a, b = b, a
    if k % 2 == 1:
        a, b = b, a
    print(a, b)

if __name__ == "__main__":
    main()

Solution (Python):
A, B, K = map(int, input().split())
for i in range(K):
  if i%2==0:
    if A%2==1:
      A = A-1
    A //= 2
    B += A
  elif i%2==1:
    if B%2==1:
      B = B-1
    B //= 2
    A += B
print(A, B)

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

Solution (Python):

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

for i in range(k):
    if i % 2 == 0:
        if a % 2 != 0:
            a -= 1
        b += a // 2
        a -= a // 2
    else:
        if b % 2 != 0:
            b -= 1
        a += b // 2
        b -= b // 2
    
print(a, b)

Solution (Python):
A, B, K = map(int,input().split())
for k in range(K):
    if k%2 == 0:
        A, B = A//2, B+A//2
    else:
        A, B = A+B//2, B//2
print(A,B)

Solution (Python):
A, B, K = map(int,input().split())

for _ in range(K // 2):
    A //= 2
    B += A
    B //= 2
    A += B
if K % 2 == 1:
    A //= 2
    B += A

print(str(A), end=" ")
print(str(B))