import Control.Applicative
import Control.Monad
import Data.List
import Text.Printf

solve :: Int -> Int -> Int -> (Int, Int)
solve a b k = go a b k True
  where
    go s t 0 v = (s, t)
    go s t u True
        | even s    = go (s `div` 2) (t + s `div` 2) (u - 1) False
        | otherwise = go ((s - 1) `div` 2) (t + (s - 1) `div` 2) (u - 1) False
    go s t u False
        | even t    = go (s + t `div` 2) (t `div` 2) (u - 1) True
        | otherwise = go ((s + (t - 1) `div` 2)) ((t - 1) `div` 2) (u - 1) True

main :: IO ()
main = do
    [a, b, k] <- fmap read . words <$> getLine :: IO [Int]
    let (s, t) = solve a b k
    printf "%d %d\n" s t