a,b,k = gets.split.map(&:to_i)
k.times do |i|
  na = a
  nb = b
  if i.even?
    na -= 1 if na.odd?
    na /= 2
    nb += na
  else
    nb -= 1 if nb.odd?
    nb /= 2
    na += nb
  end
  a = na
  b = nb
end
puts "#{a} #{b}"
