{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC

main :: IO ()
main = do
  xs <- BC.getLine
  BC.putStrLn $ BC.map (\x -> if x == '1' then '9' else '1') xs

