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

takahashi :: Int -> Int -> Int -> String
takahashi a b 0 = (show a) ++ " " ++ (show b)
takahashi a b k = aoki (a`div`2) (b+(a`div`2)) (k-1)

aoki :: Int -> Int -> Int -> String
aoki a b 0 = (show a) ++ " " ++ (show b)
aoki a b k = takahashi (a+(b`div`2)) (b`div`2) (k-1)