a, b, k = io.read("*n", "*n", "*n")
for i = 1, k do
  if i % 2 == 1 then
    if a % 2 == 1 then a = a - 1 end
    a = a // 2
    b = b + a
  else
    if b % 2 == 1 then b = b - 1 end
    b = b // 2
    a = a + b
  end
end
print(a .. " " .. b)
