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