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.
A, B, K = map(int, input().split())

while True:
    if K == 0:
        break
    else:        
        if A%2 !=0:
            A -= 1
        B += A//2
        A = A//2
        print(A,B)
        K -= 1

    if K == 0:
        break
    else:       
        if B%2 !=0:
            B -= 1
        A += B//2
        B = B//2
        print(A,B)
        K -= 1
    
print(A,B)
A, B, K = map(int, input().split())

while True:
    if K == 0:
        break
    else:        
        if A%2 !=0:
            A -= 1
        B += A//2
        A = A//2
        K -= 1

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