def turn(n)
    if n % 2 == 1
        n -= 1
    end
    return n/2
end

a,b,k = gets.chomp.split.map(&:to_i)
for i in 1..k
    if i % 2 == 1
        temp = turn(a)
        a = temp
        b += temp
    else
        temp = turn(b)
        b = temp
        a += temp
    end
end

puts "#{a} #{b}"