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

takahashi = A
aoki = B

K.times do |i|
  if i % 2 == 0
    takahashi -= 1 unless takahashi % 2 == 0
    aoki += (takahashi / 2)
    takahashi /= 2
  else
    aoki -= 1 unless aoki % 2 == 0
    takahashi += (aoki / 2)
    aoki /= 2
  end
end

puts "#{takahashi} #{aoki}"
