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):
import numpy as np

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

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

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

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

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

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

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

Solution (Python):
s=input();print(((int(s[0])%9)*8+1)*100+((int(s[1])%9)*8+1)*10+(int(s[2])%9)*8+1)

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

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

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

Solution (Python):

l = []
inp = input()
for i in range(len(inp)):
    if inp[i] == "1":
        l.append("9")
    elif inp[i] == "9":
        l.append("1")
    else:
        l.append(inp[i])

for i in range(len(l)):
    print(l[i], end='')

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

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

Solution (Python):
s = input()

for item in s:
  if item == "1":
    print("9", end="")
  elif item == "9":
    print("1", end="")
  else:
    print(item, end="")

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

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

for i in str:
    if i == "9":
        print("1", end="")
    else:
        print("9", end="")

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

ans = list()

for i in str:
    if i == "9":
        ans.append("1")
    else:
        ans.append("9")

for a in ans:
    print(a, end="")

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

Solution (Python):
print(''.join(['91'[b] for b in map(lambda a:a=='9',input())]))

Solution (Python):
s, = input().split()
t=""
for i in s:
    x = ""
    if i == '9':
        x = '1'
    elif i == '1':
        x = '9'
    else:
        x = i
    t += x
print(t)

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

Solution (Python):
N=input()
answer=""
if N[0]=="1":
  answer+="9"
else:
  answer+="1"
if N[1]=="1":
  answer+="9"
else:
  answer+="1"
if N[2]=="1":
  answer+="9"
else:
  answer+="1"
print(answer)

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

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

Solution (Python):


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

Solution (Python):
print(input().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'
answer = 100*int(N[0])+10*int(N[1])+int(N[2])
print(answer)

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

for i in range(len(N)):
  if N[i] == str(1):
    N[i] = str(9)
  elif N[i] == str(9):
    N[i] = str(1)

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

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

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

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

Solution (Python):
N=int(input())
A=N//100
B=(N-A*100)//10
C=N-A*100-B*10
if A==1:
    A=9
elif A==9:
    A=1
if B==1:
    B=9
elif B==9:
    B=1
if C==1:
    C=9
elif C==9:
    C=1
ans=A*100+B*10+C
print(ans)

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

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

Solution (Python):
number = int(input())
answer = 0

for i in range(3):
    divider = 10 ** (2-i)
    target_org = int(number / divider)
    target = 0

    if target_org == 1:
        target = 9
    elif target_org == 9:
        target = 1
    else:
        target = target_org

    answer += target * 10 ** (2-i)

    number -= target_org * 10 ** (2-i)



print(answer)

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

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

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

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

Solution (Python):
n = input()

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

print(result)

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

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

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

Solution (Python):
n = str(input())
one_idx = []
nine_idx = []
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

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

result = ""

for a in n:
  if a == '1':
    result += '9'
  else:
    result += '1'


print(result)

Solution (Python):
A = input()
for a in A:
  if a is "1":
    print("9", end="")
  else:
    print("1", end="")
print("")

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

Solution (Python):
list1 = list(input())
list2 = []
for item in list1:
    if(item == "1"):
        item_mod = item.replace("1","9")
    else:
        item_mod = item.replace("9","1")
    list2.append(item_mod)
for i in list2:
    print(i,end="")

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n_list = list(input())
answer = ''
for i in n_list:
    if i == '1':
        answer += '9'
    else:
        answer += '1'
print(answer)

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

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(int("".join(n)))

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(int("".join(n)))

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

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

Solution (Python):
if __name__ == "__main__":
    n = input()

    t = ''
    for c in n:
        if c == '1':
            t += '9'
        elif c == '9':
            t += '1'

    print(t)

Solution (Python):
ri = lambda: int(input())
rl = lambda: list(map(int,input().split()))
rr = lambda N: [ri() for _ in range(N)]
YN = lambda b: print('YES') if b else print('NO')
yn = lambda b: print('Yes') if b else print('No')
OE = lambda x: print('Odd') if x%2 else print('Even')
INF = 10**18

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

print(int(ans))

Solution (Python):
s = input()
t = ''
for c in s:
    if c == '1':
        t += '9'
    elif c == '9':
        t += '1'
print(t)

Solution (Python):
S = input()
for x in S:
  if x == '1':
    print('9', end = "")
  elif x == '9':
    print('1', end = "")
  else:
    print(x, end = "")
print()

Solution (Python):
n =input()

n = n.replace('9','0')
n = n.replace('1','9')
n = n.replace('0','1')
print(n)

Solution (Python):
from sys import stdin
N=(stdin.readline().rstrip())
ans=""
for i in N:
    if i=="1":
        ans+="9"
    else:
        ans+="1"
print(ans)

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()
a="1" if N[0]=="9" else "9"
b="1" if N[1]=="9" else "9"
c="1" if N[2]=="9" else "9"
print(a+b+c)

Solution (Python):
def main():
    n = input()
    new_n = ''
    for i in n:
        if i == '9':
            i = '1'
        elif i == '1':
            i = '9'
        new_n += i
    print(new_n)


if __name__ == "__main__":
    main()

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

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

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

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

print(ans)
print()

Solution (Python):

n = input()
print(1, end="") if n[0] == "9" else print(9, end="")
print(1, end="") if n[1] == "9" else print(9, end="")
print(1) if n[2] == "9" else print(9)

Solution (Python):
num=input()
num_str=list(num)
lengh=len(num_str)
tmp=num_str
for i in range(lengh):
    if num_str[i]=="1":
        tmp[i]="9"
    elif num_str[i]=="9":
        tmp[i]="1"
ans="".join(tmp)
print(ans)

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

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

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

Solution (Python):



n = input()
result = ''

for i in n:
    if i=='9':
        result+='1'
    elif i=='1':
        result +='9'

print(result)

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

Solution (Python):


S = input()

nS = ['1' if s == '9' else '9' for s in S]

print(''.join(nS))

Solution (Python):
def solve(string):
    return string.replace("1", "a").replace("9", "1").replace("a", "9")


if __name__ == '__main__':
    print(solve(input()))

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

Solution (Python):






n = str(input())





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





print(int("".join(ans)))

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

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

Solution (Python):
n = int(input())
if n == 111:
  print(999)
if n == 119:
  print(991)
if n == 191:
  print(919)
if n == 199:
  print(911)
if n == 911:
  print(199)
if n == 919:
  print(191)
if n == 991:
  print(119)
if n == 999:
  print(111)

Solution (Python):
N = str(input())
l = list(N)
a_l = []
for i in range(len(N)):
    a_l.append(10 - int(l[i]))
ans = "".join([str(i) for i in a_l])
print(ans)

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

Solution (Python):
n=str(input())
l=list(n)
a_l=[]
for i in range(len(n)):
    a_l.append(10-int(l[i]))
ans=''.join([str(i) for i in a_l])
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

n = input()
rtn = ""
for ni in n:
  if ni == "1":
    rtn += "9"
  elif ni == "9":
    rtn += "1"

print(rtn)

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

Solution (Python):


n = int(input())

List = list(str(n))

num = ' '
for i in range(len(List)):
    if List[i] == '1':
        num += '9'
    if List[i] == '9':
        num += '1'
print(int(num))

Solution (Python):
a = int(input())
print(1000 - a + 110)

Solution (Python):
num = list(input())
result = ""
for i in range(len(num)):
    if num[i] == '1':
        result += '9'
    if num[i] == '9':
        result += '1'
print(result)

Solution (Python):
from sys import stdin

n = stdin.readline().rstrip().replace('1', '8').replace('9', '1').replace('8', '9')
print(n)

Solution (Python):
snk = input()

snk = snk.replace("1", "a").replace("9", "b")
print(int(snk.replace("a", "9").replace("b", "1")))

Solution (Python):
n = str(input())
L = list(n)
new =[]

for i in n:
    if i =='1':
        new.append('9')
    else:
        new.append('1')

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

Solution (Python):
n = str(input())
L = list(n)
new =[]

for i in n:
    if i =='1':
        new.append('9')
    else:
        new.append('1')

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

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

Solution (Python):
n = input()

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

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

print(int(s))

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

Solution (Python):
n = input()

string = ""
for s in n:
	if s  == "9":
		string += "1"
	if s == "1":
		string += "9"

print(string)

Solution (Python):
li = list(map(int,input()))
p = ''
for a in li:
    a = 10 - a
    p += str(a)
print(p)

Solution (Python):
ans=0
N=int(input())
if N//100==1:
  N=N-100
  ans=ans+900
else:
  N=N-900
  ans=ans+100
if N//10==1:
  N=N-10
  ans=ans+90
else:
  N=N-90
  ans=ans+10
if N//1==1:
  ans=ans+9
else:
  ans=ans+1
print(ans)

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

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

print(s)

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

Solution (Python):
N = input()
N = str(N).replace("9","_").replace("1","9").replace("_","1")
print(N)

Solution (Python):
import sys
stdin = sys.stdin
 
sys.setrecursionlimit(10**7) 
 
def li(): return map(int, stdin.readline().split())
def li_(): return map(lambda x: int(x)-1, stdin.readline().split())
def lf(): return map(float, stdin.readline().split())
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(stdin.readline())
def nf(): return float(stdin.readline())



a = str(input())
ans=''
for c in a:
    if c=='1':
        ans = ans + '9'
    elif c=='9':
        ans = ans + '1'
    else:
        ans = ans + c

print(ans)

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

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

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

print(a)

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

Solution (Python):
n = input()
l = [int(x) for x in list(str(n))]
for item in l:
    if item == 1:
        print(9,end='')
    else:
        print(1,end='')

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

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

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

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

Solution (Python):


import math
import sys
import heapq
from operator import itemgetter
import itertools
input = sys.stdin.readline











n = str(input().rstrip())

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

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

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

Solution (Python):
print 1110-input()

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

if n == 111:
    print(999)
elif n == 119:
    print(991)
elif n == 191:
    print(919)
elif n == 199:
    print(911)
elif n == 911:
    print(199)
elif n == 919:
    print(191)
elif n == 991:
    print(119)
else:
    print(111)

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

Solution (Python):
n = input()

def change(d):
  if d == '1':
    return '9'
  elif d == '9':
    return '1'
  else:
    return d

print(''.join([change(d) for d in n]))

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

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

Solution (Python):
n = input()

print("".join([str(10 - int(i)) for i in 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, sep='')

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

Solution (Python):
S = input()

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

Solution (Python):
n = input().strip()

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

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 = int(input())
print(1110 - n)

Solution (Python):
a = list(input())
b = ''
for i in a:
  if i == '1':
    b += '9'
  else:
    b += '1'
print(str(b))

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

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

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

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

suuji = ""
for i in narray:
    if i == "1":
        i = "9"
    elif i == "9":
        i = "1"
    suuji += i
print(suuji)

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

suuji = ""
for i in narray:
    if i == "1":
        i = "9"
    elif i == "9":
        i = "1"
    suuji += i
print(int(suuji))

Solution (Python):
n = input()

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

Solution (Python):

s = str(input())
result = ''

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

Solution (Python):
def main() -> None:
    n = input()
    out = ""
    for v in n:
        if v == '9':
            out += "1"
        elif v == '1':
            out += "9"
    print(out)


if __name__ == '__main__':
    main()

Solution (Python):
n=input()
num=[]
for i in range(len(n)):
    num.append(n[i])
for j in range(len(n)):
    if num[j]=="1":
        num[j]="9"
    elif num[j]=="9":
        num[j]="1"
result=""
for k in range(len(n)):
    result+=num[k]
print(result)

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

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="")

Solution (Python):
n = input()

print(n.translate(str.maketrans({"1":"9", "9":"1"})))

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  n = str(input())
  m = ''
  for i in range(len(n)):
    if n[i] == '1':
      m += '9'
    elif n[i] == '9':
      m += '1'
    else:
      m += n[i]
  print(int(m))

if __name__ == '__main__':
  main()

Solution (Python):
import sys

def main():
  input = sys.stdin.readline
  n = str(input())
  m = ''
  for i in range(len(n)):
    if n[i] == '1':
      m += '9'
    elif n[i] == '9':
      m += '1'
    else:
      m += n[i]
  print(int(m))

if __name__ == '__main__':
  main()

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

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

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

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

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

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

Solution (Python):
c = {'1':'9', '9':'1'}
n = list(input())
for i in range(3):
    n[i] = c[n[i]]
print(int(''.join(n)))

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

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

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

Solution (Python):


















def inpl(): return list(map(int, input().split()))


S = input()

new_S = ""
for s in S:
  if s == "9":
    new_S = new_S + "1"
  elif s == "1":
    new_S = new_S + "9"
  else:
    new_S = new_S + s

print(new_S)

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

Solution (Python):
print(111+999-int(input()))

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

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

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

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

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

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

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

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

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

Solution (Python):
print(111 + 999 - int(input()))

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

Solution (Python):



import array
from bisect import *
from collections import *
import fractions
import heapq 
from itertools import *
import math
import random
import re
import string
import sys

S = input()
T = ''
for ch in S:
    if ch == '1':
        T += '9'
    else:
        T += '1'
print(T)

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(1110-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'
print("".join(n))

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

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

Solution (Python):
n = input()

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

print(''.join(ans_list))

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=int(input())
change_1_9=[]
a=n//100
b=(n-100*a)//10
c=n-100*a-10*b


if (a==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
if (b==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
if (c==9):
  change_1_9.append(1)
else:
  change_1_9.append(9)
print(''.join(map(str,change_1_9)))

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

Solution (Python):


def main():
    n = int(input())

    print(1110 - n)


if __name__ == '__main__':
    main()

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

answer = ''

for i, s in enumerate(string):
  if s == '1':
    string[i] = '9'
  if s == '9':
    string[i] = '1'
  answer += string[i]

print(answer)

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

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

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

Solution (Python):
""" AtCoder """

import sys
input = sys.stdin.readline

n = input()

ans = []

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

Solution (Python):
n = list(input().rstrip())
for i, x in enumerate(n):
    if x == '1': n[i] = '9'
    if x == '9': n[i] = '1'
print(''.join(n))

Solution (Python):
n = input()

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

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

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

Solution (Python):
n=input()

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

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

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

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


main()

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

Solution (Python):

n = int(input());
print( 1110 - n )

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

print(result)

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

Solution (Python):
n = list(map(int,list(input())))

a= list(10 - x for x in n)

print('{0[0]}{0[1]}{0[2]}'.format(a))

Solution (Python):
n = input()
a = []
for i in n:
    a.append(10 - int(i))
for i in a:
    print(i, end = '')

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

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

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

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

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

lst = []
res = []

while n > 0:
    lst.append(n%10)
    n //= 10
    
lst.reverse()


for i in lst:
    if i == 1:
        res.append(9)
    elif i == 9:
        res.append(1)
    else:
        res.append(i)


S = ""

for j in res:
    S += str(j)

print(S)

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

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

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

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

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

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

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

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

Solution (Python):
lst = ""
a = input()
if a[0] == "9":
    lst += "1"
else:
    lst += "9"

if a[1] == "9":
    lst += "1"
else:
    lst += "9"

if a[2] == "9":
    lst += "1"
else:
    lst += "9"

print(lst)

Solution (Python):
n = list(input().rstrip())
for i in n:
	if i == '9': print('1', end='')
	else: print('9', end='')
print()

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

n = n.replace("1", "&")
n = n.replace("9", "1")
n = n.replace("&", "9")
print(n)

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

Solution (Python):
S = input()

s = ""
for c in S:
    if c == "9":
        s = s + "1"
    elif c == "1":
        s = s + "9"
    else:
        s = s + c

print(s)

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

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