a,b,c=gets.chomp.split.map(&:to_i)
def mm(number1,number2)
    if number1%2 != 0 then
        number1 = number1-1
    end
    number2 = number2 +(number1/2)
    number1 = number1/2
    return number1,number2
end

c.times{
    b,a = mm(a,b)
}
if c%2==0 then
    puts [a,b].join(" ")
else
    puts [b,a].join(" ")
end