taka, aoki, k = gets.chomp.split.map(&:to_i)


for i in 1..k
    if i % 2 == 1
        if taka % 2 == 1
            taka -= 1
        end
    
        taka /= 2
        aoki = aoki + taka

    else

        if aoki % 2 == 1
            aoki -= 1
        end

        aoki /= 2
        taka = taka + aoki
    end

end

puts "#{taka} #{aoki}"