a, b, k = gets.chomp.split.map{|c| c.to_i}

for i in (1..k) do
    if i.odd? then
        if a.odd? then
            a -= 1
        end
        move = a/2
        b += move
        a -= move
    else
        if b.odd? then
            b -= 1
        end
        move = b/2
        a += move
        b -= move
    end
end

puts(a.to_s + " " + b.to_s)
