a,b,x = gets.split.map(&:to_i)
x.times{|i|
 if i.even? 
   if a.odd?
		a = a-1
     	b += a/2
     	a = a/2
     	else
     	    b += a/2
     	    a = a/2
   end
 end
  if i.odd? 
    if b.odd?
		b = b-1
      	a += b/2
      	b = b/2
      	else
      	    a += b/2
      	    b = b/2
    end
  end
  }
  puts "#{a} #{b}"