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

k.times do |i|
  if i.even?
    if a.odd?
      a -= 1
    end
    h = a/2
    a -= h
    b += h
  else
    if b.odd?
      b -= 1
    end
    h = b/2
    b -= h
    a += h
  end
end
puts "#{a} #{b}"
