def sousa(a,b)
  if a%2 == 1
    a -= 1
  end
  a /= 2
  b += a
  return [a,b]
end

a,b,k = gets.chomp.split.map(&:to_i)
(k/2).times do
  a,b = sousa(a,b)
  b,a = sousa(b,a)
end
if k%2 == 1
  a,b = sousa(a,b)
end
print("#{a} #{b}")
