import Text.Printf

main = do
  [a,b,k] <- map read . words <$> getLine :: IO [Int]
  let (x,y) = takahashi a b k
  printf "%d %d\n" x y
  
takahashi a b k
  | k==0 = (a,b)
  | otherwise = aoki (a`div`2) (b+a`div`2) (k-1)

aoki a b k
  | k==0 = (a,b)
  | otherwise = takahashi (a+b`div`2) (b`div`2) (k-1)

