a,b,k=gets.chomp.split(" ").map { |e| e.to_i }

for i in 1..k do
  if i % 2 == 1
    if a % 2 == 1
      a -= 1
    end
    b += a/2
    a = a/2
  else
    if b % 2 == 1
      b -= 1
    end
    a += b/2
    b = b/2
  end
end

printf("%d %d\n",a,b)