f [a,b] c k = if c==0 then [a,b] else if k==0 then if mod a 2 ==1 then f [div(a-1)2,b+div(a-1)2] (c-1) 1 else f [div a 2,b+div a 2] (c-1) 1
               else if mod b 2 == 1 then f [a+div(b-1)2,div(b-1)2] (c-1) 0 else f [a+div b 2,div b 2] (c-1) 0
main=do
 [a,b,c]<-map read.words<$>getLine
 putStrLn$unwords$map show$f [a,b] c 0