import Data.List
import Data.Tuple
import Data.Monoid
import Data.Foldable

oper (a, b) = let h = div a 2 in (b+h, h)

f [a, b, k] = (if odd k then swap else id) $ appEndo (foldMap Endo (replicate k oper)) (a, b)

joinTuple (a, b) = show a ++ " " ++ show b

main = do
    map read . words <$> getLine >>= putStrLn . joinTuple . f