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

k.times do
  if turn # 高橋
    if a % 2 != 0
      a -= 1
    end
    num = a / 2
    a /= 2
    b += num
  else
    if b % 2 != 0
      b -= 1  
    end
    num = b / 2
    b /= 2
    a += num
  end
  turn = !turn
end

puts "#{a} #{b}"