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

k.times do |i|
  if i % 2 == 0
    if a % 2 == 1
      a -= 1
    end
    exchange = a/2
    a -= exchange
    b += exchange
  else
    if b % 2 == 1
      b -= 1
    end
    exchange = b/2
    b -= exchange
    a += exchange
  end
end


puts "#{a} #{b}"
