a,b,k=gets.split.map(&:to_i)
def manu(x,y)
	x -= 1 if x%2 == 1
	x%2 == 0
	x /= 2
	y += x
	return x,y
end
k_odd = false
if k%2 == 1 then
	k -= 1
	k_odd = true
end
(k/2).times do
	a,b = manu(a,b)
	b,a = manu(b,a)
end
a,b = manu(a,b) if k_odd
puts [a,b].join(" ")