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

k.times do |i|
    if i % 2 == 0
        a -= 1 if a.odd?
        b += a / 2
        a /= 2
    else
        b -= 1 if b.odd?
        a += b / 2
        b /= 2
    end
end

puts "#{a} #{b}"