a, b, k = gets.split.map(&:to_i)

def exchange(x, y)
  x -= 1 if x.odd?
  y += (x /= 2)
  [x, y]
end

k.times do |i|
  if i.even?
    a, b = exchange(a, b)
  else
    b, a = exchange(b, a)
  end
end

puts "#{a} #{b}"