Problem:
 Score : 100 points    Problem 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 .      Constraints  111 \leq n \leq 999  n is an integer consisting of digits 1 and 9 .         Input Input is given from Standard Input in the following format:  n       Output Print the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n .        Sample Input 1 119      Sample Output 1 991  Replace the 9 in the ones place with 1 , the 1 in the tens place with 9 and the 1 in the hundreds place with 9 . The answer is 991 .       Sample Input 2 999      Sample Output 2 111

Solution (Python):
n=list(input())
ans=""
for i in range(3):
    if n[i]=="1":
        ans+="9"
    else:
        ans+="1"
print(int(ans))

Solution (Python):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=STR()
    a=[]
    for i in range(len(n)):
        
        if n[i]=='1':
            a.append('9')
        else:
            a.append('1')
    print(*a,sep='')
if __name__ == '__main__':
    do()

Solution (Python):
n = list(input())

for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"

ans = "".join(n)
print(ans)

Solution (Python):
n = input()
n = n.replace("1","x")
n = n.replace("9","1")
n = n.replace("x","9")
print(n)

Solution (Python):
print(1110-int(input()))

Solution (Python):
n = input()

ans = ''

for i in n:
    if i == '1':
        ans += '9'
    else:
        ans += '1'

print(ans)

Solution (Python):
A=input()
B=""
for i in A:
    if i=="1":
        B+="9"
    elif i=="9":
        B+="1"
    else:
        B+=i
print(B)

Solution (Python):
N = input()
ans=""
for i in range(3):
	if(str(N[i])=="1"):
		ans+="9"
	else:
		ans+="1"
print(int(ans))

Solution (Python):
def switch(intput):
    s = str(intput)
    l = ""
    for x in s:
        if x == "9":
            l += "1"
            continue
        elif x == "1":
            l += "9"
    print(l)
    
switch(input())

Solution (Python):
n = input()

ans = ""
for _n in n:
    if _n == "1":
        ans += "9"
    elif _n == "9":
        ans += "1"
    else:
        ans += _n
print(ans)

Solution (Python):
a = input()
l = list(a)
for i in range(len(a)):
    if l[i] == "9":
        l[i] = "1"
    elif l[i] == "1":
        l[i] = "9"
print("".join(l))

Solution (Python):
s=input()
ans=""

for i in range(len(s)):
  if s[i]== "1":
    ans+="9"
  else:
    ans+="1"
print(ans)

Solution (Python):
n=list(input())
for i in range(len(n)):
    if n[i]=="1":
        n[i]="9"
    else:
        n[i]="1"
print("".join(n))

Solution (Python):
n = list(str(input()))
for i in range(3):
    if n[i] == "1":
        n[i] = "9"
    else:
        n[i] = "1"
print("".join(n))

Solution (Python):
import math

n = input()
ans = ""
for i in n:
    if i == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

Solution (Python):
S = list(input())

ans = ""
for i in range(3):
    if S[i] == "1":
        ans += "9"
    elif S[i] == "9":
        ans += "1"

print(ans)

Solution (Python):
n=input()
ans=""
for i in n:
    if i=="1":
        ans+="9"
    else:
        ans+="1"
print(ans)

Solution (Python):
s = list(str(input()))

for i in range(3):
    if s[i] == '1':
        s[i] = '9'

    else:
        s[i] = '1'

print (''.join(s))

Solution (Python):
n = input()
l = []
for i in n:
    if i == "1":
        l.append("9")
    elif i == "9":
        l.append("1")
print("".join(l))

Solution (Python):
n = int(input())
print(1110 - n)

Solution (Python):
n = input()

l = []

for x in n:
    if x == '1':
        x = '9'
        l.append(x)
    elif x == '9':
        x = '1'
        l.append(x)
    else:
        l.append(x)

print(''.join(l))

Solution (Python):
S = input()

ans = ""

for s in S:
    if s == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

Solution (Python):
n = input()

for i in n:
    if i == '1':
        print(9,end='')
    else:
        print(1,end='')
print()

Solution (Python):
n = str( input() )
print( n.replace( "1", "0" ).replace( "9", "1" ).replace( "0", "9" ) )

Solution (Python):
n = list(str(int(input())))
ans = ""
for i in n :
	if i == "1" :
		ans += "9"
	else :
		ans += "1"
print(int(ans))

Solution (Python):
N = input()
str = list(N)
for i in range(3):
  if str[i] == "9":
    str[i] = "1"
  elif str[i] == "1":
    str[i] = "9"
str2 = "".join(str)
print(str2)

Solution (Python):
n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n[i]="9"
    elif n[i]=="9":
        n[i]="1"
    print(n[i],end="")

print()

Solution (Python):
n = input()
print(n.translate(str.maketrans({"1": "9","9":"1"})))

Solution (Python):
s = input()
ans = s.replace('9','temp').replace('1','9').replace('temp','1')
print(ans)

Solution (Python):
n = input()
print(n.translate(str.maketrans({'1': '9', '9': '1'})))

Solution (Python):
l=input()
a={"1":"9","9":"1"}
for i in l:
  print(a[i],end="")

Solution (Python):
a=input()

for i in a:
  print(10 - int(i),end='')
print()

Solution (Python):
import sys
import numpy as np
input = sys.stdin.readline
n = list(input().rstrip())
for i in range(len(n)):
    if n[i] == "1":
        n[i] = "9"
    else:
        n[i] = "1"
print("".join(n))

Solution (Python):
s = input()
s = s.replace('1', 'c')
s = s.replace('9', '1')
s = s.replace('c', '9')

print(s)

Solution (Python):
n=[i for i in input()]
for i in range(3):
    if n[i]=='1':
        n[i]='9'
    elif n[i]=='9':
        n[i]='1'
print(n[0]+n[1]+n[2])

Solution (Python):
n = input()
ans = int(n.replace("1", "X").replace("9", "1").replace("X", "9"))
print(ans)

Solution (Python):
n=input()
reverse_str = ''
for s in n:
  if s == '1':
    reverse_str = reverse_str + '9'
  elif s == '9':
    reverse_str = reverse_str + '1'
  else:
    reverse_str = reverse_str + s

print(reverse_str)

Solution (Python):
print(input().replace('1','d').replace('9','1').replace('d','9'))

Solution (Python):
n = input()
ans = n.replace('1','x').replace('9','1').replace('x','9')
print(ans)

Solution (Python):
print("".join("1" if c == "9" else "9" for c in input()))

Solution (Python):
print(input().replace("1","2").replace("9","1").replace("2","9"))

Solution (Python):
n = list(map(int, input()))
for i in range(3):
    if n[i] == 1:
        n[i] = 9
        continue
    if n[i] == 9:
        n[i] = 1
a = "".join(map(str, n))
print(a)

Solution (Python):
print(input().replace("1", "3").replace("9", "1").replace("3", "9"))

Solution (Python):
n = input()
res = ""
for i in n:
    tmp = 10 - int(i)
    res += str(tmp)
print(res)

Solution (Python):
print(1110 - int(input()))

Solution (Python):
N = str(input())
O=N.replace('1','5')
P=O.replace('9','1')
Q=P.replace('5','9')
print(Q)

Solution (Python):
s=list(input())
for i in range(3):
  if s[i]=='1':
    s[i] = '9'
  else:
    s[i] = '1'

print(''.join(s))

Solution (Python):
a=int(input())
print(1110-a)

Solution (Python):
s = input()
s = s.replace('1','2')
s = s.replace('9','1')
s = s.replace('2','9')
print(s)

Solution (Python):
n = str(input())

print(n.replace("1", "one").replace("9", "1").replace("one", "9"))

Solution (Python):
n=list(input())
for i in range(3):
    if n[i]=="1":
        n[i]="9"
    elif n[i]=="9":
        n[i]="1"
print(int("".join(n)))

Solution (Python):
print(((input().replace("1","d")).replace("9","1")).replace("d","9"))

Solution (Python):
print(1110-int(input()))

Solution (Python):
print(input().translate(str.maketrans({'1':'9','9':'1'})))

Solution (Python):
print(''.join(list('9'if x=='1'else'1'for x in input())))

Solution (Python):
print("".join(map(lambda x: "1" if x == "9" else "9", input())))

Solution (Python):

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

print(input()[:-1].replace('1', 'a').replace('9', '1').replace('a', '9'))

Solution (Python):
i=input()
for a in i:
  if a=="9":
    print(1,end='')
  if a=='1':
    print(9,end='')

Solution (Python):
n = input()

ans = []

for i in range(len(n)):
    if n[i] == '1':
        ans.append(9)
    else:
        ans.append(1)
        
print(*ans,sep="")

Solution (Python):
n = input()

ans = ''
for x in n:
  if x == '1':
    ans += '9'
  elif x == '9':
    ans += '1'
  else:
    ans += x
print(ans)

Solution (Python):
S = input()
s = S.replace('1','x')
s = s.replace('9','1')
s = s.replace('x','9')
print(s)

Solution (Python):


n=list(map(int,list(input())))
no=[] 

for ni in n:
    no.append(str(10-ni))

print("".join(no))

Solution (Python):
n=str(input())
ans=""
for i in range(len(n)):
    if n[i]=="1":
        ans+="9"
    else:
        ans+="1"
print(ans)

Solution (Python):
n=input()
ans = n.replace("1","x").replace("9","1").replace("x","9")
print(int(ans))

Solution (Python):
def main():
    n = list(input())
    s = ''
    for val in n:
        if val == '1':
            s += '9'
        else:
            s += '1'
    print(s)


if __name__ == '__main__':
    main()

Solution (Python):
s=input()
x=""
for i in range(len(s)):
    if s[i]=="1":
        x+="9"
    else:
        x+="1"
print(x)

Solution (Python):

import math


n = int(input())

print (1110 - n)

Solution (Python):
n = int(input())
print(1110 - n)

Solution (Python):
n=input()
print(n.replace("1","x").replace("9","1").replace("x","9"))

Solution (Python):
n=input()
n=n.replace("1","a")
n=n.replace("9","1")
print(n.replace("a","9"))

Solution (Python):
n = list(input())

for i, num in enumerate(n):
  if num == '1':
    num = '9'
  else:
    num = '1'
  n[i] = num

ans = ''.join(n)
print(ans)

Solution (Python):
n = input()
ans = ''
for i in n:
    if i == '1':
        ans+='9'
    else:
        ans+='1'
print(ans)

Solution (Python):
n = list(input())
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print("".join(n))

Solution (Python):
n=list(input())
ans=[]
for item in n:
  if item=="1":
    ans.append("9")
  elif item=="9":
    ans.append("1")
ans="".join(ans)
print(ans)

Solution (Python):
s = list(input())

for i in range(3):
    if s[i] == "1":
        s[i] = "9"
    else:
        s[i] = "1"
print("".join(s))

Solution (Python):
S = list(input())
for s in S:
    if s == "1":
        print("9",end = "")
    else:
        print("1",end = "")

Solution (Python):
n = input()
for c in n:
    if (c == '1'):
        print('9', end='')
    elif (c == '9'):
        print('1', end='')
    else:
        print(c, end='')
print()

Solution (Python):
n = input()
N = list(n)
for i in range(3):
  if N[i]=='1':
    N[i]='9'
  elif N[i]=='9':
    N[i]='1'
print(N[0]+N[1]+N[2])

Solution (Python):
n = input()
N = list(n)
for i in range(3):
  if N[i]=='1':
    N[i]='9'
  elif N[i]=='9':
    N[i]='1'
print(N[0]+N[1]+N[2])

Solution (Python):
n = input()
ans = ''
for s in n:
    ans += str(10-int(s))

print(ans)

Solution (Python):
s = input()

for i in range(len(s)):
    if s[i]=="1":
      print(9, end="")
    else:
      print(1, end="")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
import heapq

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = input()

for i in n:
	if i == '1':
		print(9, end="")
	elif i == '9':
		print(1, end="")
	else:
		print(i, end="")

Solution (Python):
n = input()
for i in n:
    print("1" if i=="9" else "9",end="")

Solution (Python):
n = input()
ans = ""
for val in n:
  if val == "1":
    val = "9"
  elif val =="9":
    val ="1"
  ans += val
print(ans)

Solution (Python):
n=list(map(str,input()))
for i in range(3):
  if n[i]=="1":
    n[i]="9"
  else:
    n[i]="1"
print("".join(map(str,n)))

Solution (Python):
s = input()
ans = ''
for i in range(0, 3):
    if s[i] == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Solution (Python):
n = list(input())
for i in range(len(n)):
  if n[i] == '1':
    n[i] = '9'
  elif n[i] == '9':
    n[i] = '1'
print("".join(n))

Solution (Python):
n = int(input())

anser = 0

if n > 200:
    anser += 100
else:
    anser += 900

if n % 100 > 20:
    anser += 10
else:
    anser += 90
    
if n % 10 > 2:
    anser += 1
else:
    anser += 9

print(anser)

Solution (Python):
n = str(input())
n = list(n)

ans = 0
for i in range(3):
    if n[i] == '1':
        ans += 9 * (10 ** (2 - i))
    elif n[i] == '9':
        ans += 1 * (10 ** (2 - i))
    else:
        ans += int(n[i]) * (10 ** (2 - i))

print(ans)

Solution (Python):
s=input()
t=s.replace("9","2")
u=t.replace("1","3")
v=u.replace("2","1")
w=v.replace("3","9")

print(w)

Solution (Python):
n=input()
a=[]
for i in n:
    if i == "1":
        a.append("9")
    else:
        a.append("1")
print(a[0]+a[1]+a[2])

Solution (Python):
nl = list(input())

nn = []
for n in nl:
    if n == "1":
        nn.append("9")
    else:
        nn.append("1")
        
print("".join(nn))

Solution (Python):
n=input()
x=1
y=1
z=1

if n[0]=="1":
    x=9
if n[1]=="1":
    y=9
if n[2]=="1":
    z=9
print(x*100+y*10+z)

Solution (Python):
str=input()
l=list(str)
ans=[]
for i in l:
  if i=="1":
    ans.append("9")
  else:
    ans.append("1")
print("".join(ans))

Solution (Python):
print("".join(["9" if x=="1" else "1" for x in input()]))

Solution (Python):
n = int(input())

print(111+999-n)

Solution (Python):
n = input()
dict = {"1" : "9", "9" : "1"}
ans = ""
for i in range(len(n)) :
    ans += dict[n[i]]
print(ans)

Solution (Python):
print(1110-int(input()))

Solution (Python):
n = str(input()).replace("1","q").replace("9","1").replace("q","9")
print(n)

Solution (Python):

n = input()
S = ""
for i in range(3):
    if n[i] == "1":
        S = S + "9"
    else:
        S = S + "1"
print(S)

Solution (Python):
n = list(input())
ans = []
for i in range(3):
    if n[i] == "1": 
        ans.append(9)
    else:
        ans.append(1)
print(*ans, sep="")

Solution (Python):
s = input()
s = s.replace("9", "
s = s.replace("1", "9")
s = s.replace("
print(s)

Solution (Python):
n = str(input())
print(n.translate(str.maketrans({
    "1":"9",
    "9":"1",
    })))

Solution (Python):
n = input()

ret = ["1" if ni=="9" else "9"  for ni in n]
ret = "".join(ret)
ret = int(ret)

  
print(ret)

Solution (Python):

import sys










def main():
    n = list(sys.stdin.readline().rstrip())
    for i in range(len(n)):
        if n[i] == '9':
            n[i] = '1'
        else:
            n[i] ='9'

    
    print(''.join(n))

if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())

print(1110 - n)

Solution (Python):
from sys import stdin

s = stdin.readline().rstrip()
ns = ""
for i in s:
    if i =="1":
        ns += "9"
    else:
        ns += "1"

print(ns)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    n=input()
    print(''.join('1' if c == '9' else '9' for c in n))

main()

Solution (Python):
S = list(map(str, input()))

for i in range(len(S)):
	if S[i] == "1":
		print(9, end="")
	elif S[i] == "9":
		print(1, end="")
	else:
		print(int(S[i]), end="")

Solution (Python):
import sys
input = sys.stdin.readline
n = list(input())[: -1]
for i in range(len(n)):
  if n[i] == "1":
    n[i] = "9"
  elif n[i] == "9":
    n[i] = "1"
print("".join(n))

Solution (Python):
n = list(str(input()))

for i in range(3):
  if n[i] == '1':
    n[i] = '9'
  else:
    n[i] = '1'

print(int(''.join(n)))

Solution (Python):
n = int(input())
res = 0
for i in str(n):
    res *= 10
    if i == "1":
        res += 9
    else:
        res += 1
print(res)

Solution (Python):

n = input()
print(str(10 - int(n[0])) + str(10 - int(n[1])) + str(10 - int(n[2])))

Solution (Python):
n = input()
res = ""
for s in n:
    if s == "1":
        res += "9"
    else:
        res += "1"
print(res)

Solution (Python):
print("".join({"1": "9", "9": "1"}[i] for i in input()))

Solution (Python):
n = input()
l = []
for i in n:
  if i == '9':
    l.append('1')
  elif i == '1':
    l.append('9')
  else:
    l.append(i)
print(int(''.join(l)))

Solution (Python):
n = input()
for i in range(len(n)):
	if n[i] == "1":
		n = n[:i] + "9" + n[i+1:]
	else:
		n = n[:i] + "1" + n[i+1:]
print(n)

Solution (Python):
print(1110-int(input()))

Solution (Python):
print(input().replace('1','n').replace('9','1').replace('n','9'))

Solution (Python):
n=input()
a=""
for i in range(3):
    if n[i]=="1":
        a+="9"
    else:
        a+="1"
print(a)

Solution (Python):
N = str(input())
ans = []
for i in range(len(N)):
    if N[i] == '1':
        ans.append('9')
    elif N[i] == '9':
        ans.append('1')
    else :
        ans.append(N[i])
print("".join(ans))

Solution (Python):
x = int(input())

s = str(x)


s1 = s.translate(str.maketrans({'1': '9', '9': '1'}))
	
print(int(s1))

Solution (Python):
N = str(input())
A = []


for m in range(3):
    if N[m] == '1':
       A.append('9')
    elif N[m] == '9':
        A.append('1')
    else:
        A.append(str(N[m]))

print(''.join(A))

Solution (Python):
n = input()
t = [0]*3
t[0] = str(10 - int(n[0]))
t[1] = str(10 - int(n[1]))
t[2] = str(10 - int(n[2]))
print(str(t[0]+str(t[1])+str(t[2])))

Solution (Python):
S = input()
conv = {'1': '9', '9': '1'}
for s in S:
    print(conv[s], end='')
print()

Solution (Python):
n = input()
n = n.replace('1','x')
n = n.replace('9','1')
n = n.replace('x','9')
print(n)

Solution (Python):
s=list(input())
ans=[]
for i in s:
  if i =='1':
    ans +=['9']
  if i =='9':
    ans +=['1']
ans=''.join(ans)
print(ans)

Solution (Python):
a = list(input())
ans = []
for i in a:
  if i == "1":
    ans.append("9")
  elif i == "9":
    ans.append("1")
  else:
    ans.append(i)
print(''.join(ans))

Solution (Python):
N = input()
ans = ''
for i in N:
    if i == '9':
        ans += '1'
    elif i == '1':
        ans += '9'
print(ans)

Solution (Python):
n=input()
print(((n.replace('1','a')).replace('9','1')).replace('a','9'))

Solution (Python):
n=int(input())
print(1110-n)

Solution (Python):
S=input()
ANS=''
for s in S:
  if s == '9':
    ANS += '1'
  elif s == '1':
    ANS += '9'
  else:
    ANS += s
print(ANS)

Solution (Python):
n = list(input())
time = 100
ans = 0
for i in range(len(n)):
	if n[i] == '1':
		ans += 9 * time
	elif n[i] == '9':
		ans += 1 * time 
	else:
		ans += int(n[i])*time
	time /= 10

print(int(ans))

Solution (Python):
n = input()

new_n = ''
for i in range(3):
    if n[i] == '1':
        new_n += '9'
    else:
        new_n += '1'

print(new_n)

Solution (Python):
r = ""
for i in input():
  r += "9" if i == "1" else "1"
print(r)

Solution (Python):
S = str(input())
ans = str('')
for i in range(len(S)):
  if S[i] == '1':
    ans += '9'
  else:
    ans += '1'
print(ans)

Solution (Python):
n=int(input())
print(1110-n)

Solution (Python):
n = input()
print(n.replace('1', '

Solution (Python):
print(input().replace("9", "x").replace("1", "9").replace("x", "1"))

Solution (Python):
n = input()
table = str.maketrans({"1": "9", "9": "1"})

print(n.translate(table))

Solution (Python):
n = int(input())
if n//100 == 1:
  n += 800
else:
  n -= 800
if (n//10)%10 == 1:
  n += 80
else:
  n -= 80
if n%10 == 1:
  n += 8
else:
  n -= 8
print(n)

Solution (Python):
n = input()
n_list = list(n)

for i in range(len(n)):
    if n_list[i] == '1':
        n_list[i] = '9'
    elif n_list[i] == '9':
        n_list[i] = '1'

ans = ''.join(n_list)        
print(ans)

Solution (Python):
n=int(input())
li=list(map(int,str(n)))
for n in range(3):
    if li[n]==1:
        li[n]=9
    elif li[n]==9:
        li[n]=1
print(li[0]*100+li[1]*10+li[2])

Solution (Python):
n=input()

for c in n:
  print('9'if c=='1' else '1', end="")

print()

Solution (Python):
s=int(input())
print(1110-s)

Solution (Python):
n = input()
print(n.replace('1', 'x').replace('9', '1').replace('x', '9'))

Solution (Python):
n = input()
ans = ""
for i in n:
    if i == "1":
        ans += "9"
    elif i == "9":
        ans += "1"
    else:
        ans += i
print(ans)

Solution (Python):
n = input()
print(n.translate(str.maketrans({'1': '9','9': '1'})))

Solution (Python):
n=list(input())
m=[]
for i in range(0,3):
  if n[i]=='9':
    m.append('1')
  else:
    m.append('9')
ma=''.join(m)
print(ma)

Solution (Python):
s=input()
s=s.translate(str.maketrans({'1':'9','9':'1'}))
print(int(s))

Solution (Python):
a,b,c=input()
print(str(10-int(a)) + str(10-int(b)) +str(10-int(c)))

Solution (Python):
n = {111: 999, 119:991, 911:199, 191:919, 199:911, 991:119, 919:191, 999:111}
print(n[int(input())])

Solution (Python):
n=list(input())
for i in range(3):
  if n[i]=='1':
    n[i]='9'
  elif n[i]=='9':
    n[i]='1'
s=''
for i in range(3):
  s+=n[i]
print(s)

Solution (Python):
s = input()
dic = {"1": "9", "9": "1"}
for c in s:
  print(dic[c], end="")

Solution (Python):
n = input()

for i in range(3):
    if n[i] == "1":
        print(9,end="")
    else:
        print(1,end="")

Solution (Python):
s = str(input())
table = s.maketrans('19','91')
print(s.translate(table))

Solution (Python):
print("".join("9" if x=="1" else "1" for x in input()))

Solution (Python):
n = str(input())
table = n.maketrans({'1':'9','9':'1'})
print(n.translate(table))

Solution (Python):
print(1110-int(input()))

Solution (Python):
n = input()
for i in range(3):
  print("9" if n[i]=="1" else "1",end="")

Solution (Python):
S = str(input())
ans = []
for i in range(3):
    if S[i]=="1":
        ans.append(9)
    elif S[i]=="9":
        ans.append(1)
        
print(''.join(map(str, ans)))

Solution (Python):

S = str(input())
ans = []
for i in range(3):
    if S[i]=="1":
        ans.append(9)
    elif S[i]=="9":
        ans.append(1)
        
print(''.join(map(str, ans)))

Solution (Python):
print(''.join([str(int(i) * 9 % 10) for i in input()]))

Solution (Python):
n = input()
print(n.replace('1', '5').replace('9', '1').replace('5', '9'))

Solution (Python):
d = {'1': '9', '9': '1'}
print(''.join([d[c] for c in input()]))

Solution (Python):
print(1110-int(input()))

Solution (Python):
def main():
    n = input()
    ans = ''
    for i in range(3):
        if(n[i]=='9'):
            ans = ans + '1'
        else:
            ans = ans + '9'
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
print(1110-n)

Solution (Python):
n = input()
ans = ""
for i in n:
  if i=='9':
    ans += "1"
  else:
    ans += "9"
print(ans)

Solution (Python):
n = list(input())
new = []
for x in n:
  if x == '1':
    new.append('9')
  elif x == '9':
    new.append('1')

print(''.join(new))

Solution (Python):
s = input()
a = [c for c in s]

if a[0]=='1':
        a[0] = '9'
else:
        a[0] = '1'

if a[1]=='1':
        a[1] = '9'
else:
        a[1] = '1'

if a[2]=='1':
        a[2] = '9'
else:
        a[2] = '1'

print(int(a[0]+a[1]+a[2]))

Solution (Python):
n = input()
a = n.replace('1','x')
b = a.replace('9','1')
c = b.replace('x','9')
print(c)

Solution (Python):
n=int(input());print(1110-n)

Solution (Python):
n = input()
print(n.replace('1', 'x').replace('9', '1').replace('x', '9'))

Solution (Python):
n = input()
for c in n:
    if c == "1":
        print("9", end="")
    elif c == "9":
        print("1", end="")

Solution (Python):
s = input()
S =[]
S.append(s)
ans = []
for i in range(len(s)):
    if S[0][i] == "1":
        ans.append("9")
    else:
        ans.append("1")
aim = "".join(ans)
print(aim)

Solution (Python):
print(input().replace("1", "a").replace("9", "b").replace("a", "9").replace("b", "1"))

Solution (Python):
N = list(input())
ans = ""
for i in N:
  if i == "1":
    ans += "9"
  else:
    ans += "1"
print(ans)

Solution (Python):
n=input()

print(n.replace("1","x").replace("9","1").replace("x","9"))

Solution (Python):
n=list(input())

for i in range(3):
      if n[i] == "1":
            n[i] = "9"
      elif n[i] == "9":
            n[i] = "1"

print("".join(n))

Solution (Python):
print(''.join([i.replace('9','1') if i!='1' else '9' for i in input()]))

Solution (Python):
a = input()
n = ""
for i in a:
  if i == "1":
    n = n + "9"
  else:
    n = n + "1"
print(int(n))

Solution (Python):
n = list(input())
for i in range(len(n)):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'
    print(n[i], end='')
print()

Solution (Python):
n=input()
for i in n:
    if i=='9':
        a='1'
    elif i=='1':
        a='9'
    else:
        a=i
    print(a,end='')

Solution (Python):
s=input()
ss = ''
for c in s:
	if c == "1":
		ss += "9"
	else:
		ss += "1"
print(ss)

Solution (Python):
'''
A - AtCoder Beginner Contest 999
https://atcoder.jp/contests/abc111/tasks/abc111_a

>>> main(119)
991
>>> main(999)
111
'''


def main(n):
    res = ''
    for _n in str(n):
        if _n == '1':
            res += '9'
        else:
            res += '1'

    print(res)


if __name__ == '__main__':
    main(int(input()))

Solution (Python):

n=input()
l=['1','9']
for i in n:
    print(l[l.index(i)-1], end = '')
print()

Solution (Python):
print(input().replace("1","x").replace("9","1").replace("x","9"))

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    print(s.replace("1", "*").replace("9", "1").replace("*", "9"))


if __name__ == '__main__':
    slove()

Solution (Python):
n = input()
ans = ''
for i in n:  
    if i == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    rep = {"1": "9", "9": "1"}
    print("".join([rep.get(c, c) for c in input().strip()]))


if __name__ == "__main__":
    main()

Solution (Python):
n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
    if i == 0:
        s = str(n[i])
    else:
        s = s+ str(n[i])
print(int(s))

Solution (Python):
N = list(input())

for i in range(3):
    if N[i] == '1':
        N[i] = '9'
    elif N[i] == '9':
        N[i] = '1'
print(''.join(N))

Solution (Python):
print(input().replace('1', 'temp').replace('9', '1').replace('temp', '9'))

Solution (Python):
n = input()
n = n.replace('1', '0')
n = n.replace('9', '1')
n = n.replace('0', '9')
print(n)

Solution (Python):
N = input()
ans = ''
for i in range(len(N)):
    if N[i] == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Solution (Python):
print(1110-int(input()))

Solution (Python):
w = input()
c = ""
for i in w:
  if i == "9":
    i = "1"
    c += i
  elif i == "1":
    i = "9"
    c += i
print(c)

Solution (Python):
n = input()
s = []
ans = 0
for i in range(len(n)):
    if n[i] == '1':
        ans += 9*(10**(2-i))
    elif n[i] == '9':
        ans += 1*(10**(2-i))
print(ans)

Solution (Python):
print("".join([i.replace("9", "1") if i != "1" else "9" for i in input()]))

Solution (Python):
print("".join([i.replace("9", "1") if i != "1" else "9" for i in input()]))

Solution (Python):
N=input()

ans=''
for i in N:
    if i == '1':
        i='9'
    else:
        i='1'
        
    ans +=i    
    
print(ans)

Solution (Python):
n = [i for i in input()]

print(''.join(['9' if i == '1' else '1' for i in n]))

Solution (Python):
s = input()
ans = []
for c in s:
  if c == '1':
    ans.append('9')
  else:
    ans.append('1')
print(''.join(ans))

Solution (Python):

n = input()
s = [(i.replace("1", "9") if i == "1" else i.replace("9", "1") if i == "9" else i) for i in n]
print(''.join(s))

Solution (Python):
print(str(1110-int(input())))

Solution (Python):
L=[[111,119,191,199,911,919,991,999],\
   [999,991,919,911,199,191,119,111]]
print(L[1][L[0].index(int(input()))])

Solution (Python):
a=int(input())
print(1110-a)

Solution (Python):
n = list(str(input()))
a = list(range(0, 10))
a[1] = 9; a[9] = 1
b = [str(a[int(i)]) for i in n]
print("".join(b))

Solution (Python):
s = input()
ans = ''
for i in range(3):
    if s[i] == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Solution (Python):
s=list(input())
for i in range(3):
  if s[i]=="1":
    s[i]="9"
  else :s[i]="1"
a=s[0]+s[1]+s[2]
print(a)

Solution (Python):
print(1110 - int(input()))

Solution (Python):
n = input()
a = ['']*3
for i in range(3):
    if n[i] == '1':
        a[i] = '9'
    elif n[i] == '9':
        a[i] = '1'
    else:
        a[i] = n[i]
print(''.join(a))

Solution (Python):
print(1110-int(input()))

Solution (Python):
n=input()
ans=n.replace("1","x")
ans=ans.replace("9","1")
ans=ans.replace("x","9")
print(ans)

Solution (Python):
n=input()
n=n.replace('1','*')
n=n.replace('9','1')
n=n.replace('*','9')
print(n)

Solution (Python):
print(1110-int(input()))

Solution (Python):
N = int(input())
print(1110-N)

Solution (Python):
n = input()
ans = []

for i in range(len(n)):
  if n[i] == "9":
    ans.append("1")
  else:
    ans.append("9")

print("".join(ans))

Solution (Python):
n = [int(_) for _ in input()]

for i in range(3):
    if n[i] == 1:
        print(9,end='')
    else:
        print(1,end='')

Solution (Python):
print(1110-int(input()))

Solution (Python):
n = input()
print(n.replace('1', '_').replace('9', '1').replace('_', '9'))

Solution (Python):
n = list(input())


for i in range(len(n)):
    if n[i] == '1':
        n[i] = '9'
    elif n[i] == '9':
        n[i] = '1'

print(''.join(n))

Solution (Python):
n=input()
m=0
if n[0]=='1':
  m+=900
else:
  m+=100
  
if n[1]=='1':
  m+=90
else:
  m+=10
  
if n[2]=='1':
  m+=9
else:
  m+=1
  
print(m)

Solution (Python):
n = list(input())
for i in range(len(n)):
    if n[i] == '1':
        n[i] = '9'
    elif n[i] == '9':
        n[i] = '1'
print(''.join(n))

Solution (Python):
n = list(input())
result = ""

for num in n:
    if num == "1":
        result += "9"
    else:
        result += "1"

print(result)

Solution (Python):
n=list(input())
ans=[]
for i in range(3):
    if n[i]=='1': ans.append('9')
    else: ans.append('1')
print(''.join(ans))

Solution (Python):
n=str(input())
print(n.translate(str.maketrans({'1':'9','9':'1'})))

Solution (Python):
n = int(input())

a = n % 10
b = ((n-a) //10) % 10
c = (n-b-a) //100

d = 0
e = 0
f = 0

if a == 1:
  d = 9
else:
  d=1
if b == 1:
  e = 9
else:
  e=1
if c == 1:
  f = 9
else:
  f=1
  
print(d + e*10 + f*100)

Solution (Python):
n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])

Solution (Python):
n = input().strip()
x = ""
for i in range(len(n)):
    if n[i]=="1":
        x += "9"
    elif n[i]=="9":
        x += "1"
print(x)

Solution (Python):
n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n[i] = "9"
    elif n[i] == "9":
        n[i] = "1"
    if i == 0:
        s = str(n[i])
    else:
        s = s+ str(n[i])
print(int(s))

Solution (Python):
n = input()

print(n.replace('9', 'X').replace('1', '9').replace('X', '1'))

Solution (Python):
n = str(input())
output = ""

for i in range(len(n)):
    if n[i] == "1":
        output = output + "9"

    elif n[i] == "9":
        output = output + "1"

print(int(output))

Solution (Python):
if __name__ == '__main__':
    N = list(str(input()))
    for i in range(len(N)):
        if N[i] == '9':
            N[i] = '1'
        else:
            N[i] = '9'
    print(''.join(N))