main = do
    (a:b:k:_)<-map read.words<$>getLine::IO [Int]
    putStrLn $ unwords $ map show $ tak a b k
tak a b k
    | k==0 = [a,b]
    | otherwise = ao (a`div`2) (b+a`div`2) (k-1)
ao a b k
    | k==0 = [a,b]
    | otherwise = tak (a+b`div`2) (b`div`2) (k-1)
