takahashi,aoki,k=gets.split.map &:to_i
turn='takahashi'
k.times do
  if turn=='takahashi'
    aoki+=takahashi/2
    takahashi/=2
    turn='aoki'
  else
    takahashi+=aoki/2
    aoki/=2
    turn='takahashi'
  end
end
print "#{takahashi} #{aoki}"
