a,b,k = gets.chomp.split(/\s/).map{|x| x.to_i}

j = 0
for i in 1..k
    a -= 1 unless a % 2 == 0
    a = a/2
    b += a

    j += 1
    break if j >= k

    b -= 1 unless b % 2 == 0
    b = b/2
    a += b

    j += 1
    break if j >= k
end

print "#{a} #{b}\n"