main = do
  line <- getLine
  let 
    func src dst
      | src == []        = dst
      | head src == '9'  = '1' : (func (tail src) dst)
      | head src == '1'  = '9' : (func (tail src) dst)
      | otherwise        = (head src) : (func (tail src) dst)
    in
      putStrLn $ func line []
