# スペース区切りの整数の入力
a,b,k=gets.chomp.split(" ").map(&:to_i);
def eat(x)
    if x%2==1
        x-=1
    end 
    return x   
end

for i in 0...k do
    if i%2==0
        a = eat(a)
        b += a/2
        a /= 2
    else
        b = eat(b)
        a += b/2
        b /= 2
    end
end

print("#{a} #{b}\n")
