A, B, K = gets.split.map(&:to_i)

a = A
b = B

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

puts [a, b].join(' ')
