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

K.times do |i|
  if i.even?
    if a.odd?
      a -= 1
    end
    t = a / 2
    b += t
    a -= t
  else
    if b.odd?
      b -= 1
    end
    t = b / 2
    a += t
    b -= t
  end
end

puts "#{a} #{b}"