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

(K/2).times do
  if A.odd?
    A = A - 1
    A = A / 2
    B = B += A
  else
    A = A / 2
    B = B += A
  end
  if B.odd?
    B = B - 1
    B = B / 2
    A = A += B
  else
    B = B / 2
    A = A += B
  end
end

if K.odd?
  if A.odd?
    A = A - 1
    A = A / 2
    B = B + A
  else
    A = A / 2
    B = B + A
  end
end

puts "#{A}\s#{B}"