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(' '))

for i in range(k):

    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        
        tmp_a = int(a / 2)

        a = tmp_a
        b = b + tmp_a

    else:
        if b % 2 == 1:
            b -= 1
        
        tmp_b = int(b / 2)

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

for i in range(k):

    if i % 2 == 0:
        if a % 2 == 1:
            a -= 1
        
        tmp_a = int(a / 2)

        a = tmp_a
        b = b + tmp_a

    else:
        if b % 2 == 1:
            b -= 1
        
        tmp_b = int(b / 2)

        b = tmp_b
        a = a + tmp_b

print(a, b)