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

(0...k).each{|i|
  if i%2==0 then
    if a%2==1 then
      a-=1
    end
    b += a/2
    a = a/2
  else
    if b%2==1 then
      b-=1
    end
    a += b/2
    b = b/2
  end
}

puts "#{a} #{b}"