output_description: Print the integer obtained by replacing each occurrence of `1` with `9` and
  each occurrence of `9` with `1` in n.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      n
attempt: #!/usr/bin/env python
  # -*- coding: utf-8 -*-
  
  import sys  # {{{
  import os
  import time
  import re
  from pydoc import help
  import string
  import math
  from operator import itemgetter
  from collections import Counter
  from collections import deque
  from collections import defaultdict as dd
  import fractions
  from heapq import heappop, heappush, heapify
  import array
  from bisect import bisect_left, bisect_right, insort_left, insort_right
  from copy import deepcopy as dcopy
  import itertools
  
  # }}}
  
  # pre-defined{{{
  sys.setrecursionlimit(10**7)
  INF = 10**20
  GOSA = 1.0 / 10**10
  MOD = 10**9 + 7
  ALPHABETS = [
      chr(i) for i in range(ord("a"), ord("z") + 1)
  ]  # can also use string module
  
  
  def LI():
      return [int(x) for x in sys.stdin.readline().split()]
  
  
  def LI_():
      return [int(x) - 1 for x in sys.stdin.readline().split()]
  
  
  def LF():
      return [float(x) for x in sys.stdin.readline().split()]
  
  
  def LS():
      return sys.stdin.readline().split()
  
  
  def I():
      return int(sys.stdin.readline())
  
  
  def F():
      return float(sys.stdin.readline())
  
  
  def DP(N, M, first):
      return [[first] * M for n in range(N)]
  
  
  def DP3(N, M, L, first):
      return [[[first] * L for n in range(M)] for _ in range(N)]
  
  
  from inspect import currentframe
  
  
  def dump(*args):
      names = {id(v): k for k, v in currentframe().f_back.f_locals.items()}
      print(
          ", ".join(names.get(id(arg), "???") + " => " + repr(arg) for arg in args),
          file=sys.stderr,
      )
  
  
  # }}}
  
  
  def local_input():  # {{{
      from pcm.utils import set_stdin
      import sys
  
      if len(sys.argv) == 1:
          set_stdin(os.path.dirname(__file__) + "/test/" + "sample-1.in")  # }}}
  
  
  def solve():
      s = input()
      res = ""
      for c in s:
          if c == "9":
              res += "1"
          else:
              res += "9"
      print(res)
      return 0
  
  
  if __name__ == "__main__":  # {{{
      try:
          local_input()
      except:
          pass
      solve()
  # vim: set foldmethod=marker:}}}
  
problem_description: Statement
  
  Cat Snuke is learning to write characters. Today, he practiced writing digits
  `1` and `9`, but he did it the other way around.
  
  You are given a three-digit integer n written by Snuke. Print the integer
  obtained by replacing each digit `1` with `9` and each digit `9` with `1` in
  n.
samples: [{"input": "119", "output": "991\n    \n\nReplace the `9` in the ones place with `1`, the `1` in the tens place with `9`\nand the `1` in the hundreds place with `9`. The answer is `991`.\n\n* * *"}, {"input": "999", "output": "111"}]