def exchange(p, q)
  p = p.odd? ? p - 1 : p
  [p / 2, q + p / 2] 
end
a, b, k = gets.split.map(&:to_i)
turn = 0
k.times do
  if turn == 0
    a, b = exchange(a, b)
  else
    b, a = exchange(b, a)
  end
  turn = 1 - turn
end
puts [a, b].join(' ')
