a, b, K = gets.split.map(&:to_i)

player, opponent = a, b
K.times do |k|
  if player.odd?
    player -= 1
  end
  player /= 2
  opponent += player
  player, opponent = opponent, player
end
a, b = if K.even?
         [player, opponent]
       else
         [opponent, player]
       end
puts "#{a} #{b}"
