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

(1..K).each do |i|
  if i.odd?
    a -= 1 if a.odd?

    a /= 2
    b += a
  else # i.odd?
    b -= 1 if b.odd?

    b /= 2
    a += b
  end
end

puts "#{a} #{b}"