require 'pp'

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

turn = :a
k.times do |i|
    if turn == :a
        if a % 2 == 1
            a -= 1
        end
        b += a / 2
        a = a / 2

        turn = :b
    else
        if b % 2 == 1
            b -= 1
        end
        a += b / 2
        b = b / 2

        turn = :a
    end
end

puts "#{a} #{b}"
