a = gets.split.map(&:to_i)

for i in (1..a[2]) do
  wait = i % 2
  eat = (i + 1) % 2
  a[eat] = a[eat] - 1 if a[eat] % 2 != 0
  a[wait] = a[wait] + a[eat] / 2
  a[eat] = a[eat] / 2
end

puts "#{a[0]} #{a[1]}"