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: ###############################################################################
  
  import sys
  from bisect import bisect_left as binl
  from copy import copy, deepcopy
  
  
  def intin():
      input_tuple = input().split()
      if len(input_tuple) <= 1:
          return int(input_tuple[0])
      return tuple(map(int, input_tuple))
  
  
  def intina():
      return [int(i) for i in input().split()]
  
  
  def intinl(count):
      return [intin() for _ in range(count)]
  
  
  def modadd(x, y):
      global mod
      return (x + y) % mod
  
  
  def modmlt(x, y):
      global mod
      return (x * y) % mod
  
  
  def lcm(x, y):
      while y != 0:
          z = x % y
          x = y
          y = z
      return x
  
  
  def get_divisors(x):
      retlist = []
      for i in range(1, int(x**0.5) + 3):
          if x % i == 0:
              retlist.append(i)
              retlist.append(x // i)
      return retlist
  
  
  def make_linklist(xylist):
      linklist = {}
      for a, b in xylist:
          linklist.setdefault(a, [])
          linklist.setdefault(b, [])
          linklist[a].append(b)
          linklist[b].append(a)
      return linklist
  
  
  def calc_longest_distance(linklist, v=1):
      distance_list = {}
      distance_count = 0
      distance = 0
      vlist_previous = []
      vlist = [v]
      nodecount = len(linklist)
  
      while distance_count < nodecount:
          vlist_next = []
          for v in vlist:
              distance_list[v] = distance
              distance_count += 1
              vlist_next.extend(linklist[v])
          distance += 1
          vlist_to_del = vlist_previous
          vlist_previous = vlist
          vlist = list(set(vlist_next) - set(vlist_to_del))
  
      max_distance = -1
      max_v = None
      for v, distance in distance_list.items():
          if distance > max_distance:
              max_distance = distance
              max_v = v
  
      return (max_distance, max_v)
  
  
  def calc_tree_diameter(linklist, v=1):
      _, u = calc_longest_distance(linklist, v)
      distance, _ = calc_longest_distance(linklist, u)
      return distance
  
  
  ###############################################################################
  
  
  def main():
      n = input()
  
      for i in n:
          if i == "1":
              sys.stdout.write("9")
          if i == "9":
              sys.stdout.write("1")
      print()
  
  
  if __name__ == "__main__":
      main()
  
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"}]