a, b, k = gets.chomp.split(" ").map(&:to_i)
k.times do |i|
  if (i + 1).odd?
    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}"