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

k.times do |i|
  if i % 2 == 0 then
    if a % 2 == 1 then
      a -= 1
    end
    
      c = a / 2
      a -= c
      b += c
  else
    if b % 2 == 1 then
      b -= 1
    end
    
      c = b / 2
      a += c
      b -= c
  end
end
    
puts [a, b].map(&:to_s).join(' ')