{-# LANGUAGE BangPatterns #-}

main :: IO ()
main = do
  [a, b, k] <- map read . words <$> getLine
  putStrLn $ unwords $ map show $ solve a b k

solve :: Int -> Int -> Int -> [Int]
solve !a !b  0 = [a, b]
solve !a !b  1 = [a1, b + a1]
  where
    a1 = a `div` 2
solve !a !b !k = solve (a1 + b1) b1 (k - 2)
  where
    a1 = a `div` 2
    b1 = (b + a1) `div` 2
