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 = input()







def convert(char):
    if char == '1':
        return '9'
    else:
        return '1'    

a = []
for c in n:
    
    a.append(convert(c))







    




    









print("".join(a))

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

Solution (Python):
N = list(input())
p = len(N)
for i in range(p):
    N[i] = 10 - int(N[i])

[print(i,end='') for i in N]

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

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

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

Solution (Python):

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

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

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

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

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

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

Solution (Python):
n = list(input())
new_n=["","",""]

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

print(new_n[0]+new_n[1]+new_n[2])

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

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

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

print(1110-n)

Solution (Python):
n = input()

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

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

Solution (Python):
n = input()

out = []

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

print("".join(out))

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

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

Solution (Python):
x=input()
n=len(x)

y=''

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

print(int(y))

Solution (Python):
s=list(input())
print("".join([str(10-int(i)) for i in s]))

Solution (Python):
N = 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):
s = input()
a = {'9':'1', '1':'9'}
print(a[s[0]] + a[s[1]] + a[s[2]])

Solution (Python):
n = input()

res = ""
for a in n:
    if a == "1":
        res += "9"
    else:
        res += "1"
        
print(res)

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

Solution (Python):
s = input()

ans = ""
for i in s:
    if int(i)==1 or int(i)==9:
        ans = ans + str(10-int(i))
    else:
        ans = ans + i

print(ans)

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

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

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

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')


def A():
    n = S()
    for i in n:
        if i == "1":
            print(9, end="")
        else:
            print(1, end="")
    print()
    return


def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == '__main__':
    A()

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

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

print(''.join(ans))

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

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):
a = input()
a = a.replace("9", "i")
a = a.replace("1", "9")
a = a.replace("i", "1")
print(a)

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

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

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

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):
a = input()
b = ''
for item in a:
    if item == '1':
        b += '9'
    else:
        b += '1'

print(b)

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

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

Solution (Python):
n = input()

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

Solution (Python):



n = list(map(str,input()))

for i in range(len(n)):
    if n[i] == "9":
        n[i] = "1"
    elif n[i] == "1":
        n[i] = "9"
print(''.join(map(str,n)))

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

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

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

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

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

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

Solution (Python):
S = input()

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

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

for i in range(3):
    if n[i]=='1':
        N+=8*(10**(2-i))
    elif n[i]=='9':
        N-=8*(10**(2-i))

print(N)

Solution (Python):

n = input()
mp = {'1' : '9',
      '9' : '1'}
string = [mp[i] if (i == "1" or i == "9") else i for i in n]
print("".join(string))

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

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

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

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

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(input())
x = []
for i in n:
  if i == '1':
    x.append(i.replace('1','9'))
  elif i == '9':
    x.append(i.replace('9','1'))
  else:
    x.append(i)
    
print(''.join(x))

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

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

print("".join(ans))

Solution (Python):
nList = list(input())
s = ""
for elm in nList:
    s += "1" if elm == "9" else "9"
print(s)

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

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

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

if s[0] == '1':
    s[0] = s[0].replace('1', '9')
elif s[0] == '9':
    s[0] = s[0].replace('9', '1')
if s[1] == '1':
    s[1] = s[1].replace('1', '9')
elif s[1] == '9':
    s[1] = s[1].replace('9', '1')
if s[2] == '1':
    s[2] = s[2].replace('1', '9')
elif s[2] == '9':
    s[2] = s[2].replace('9', '1')

print(''.join(s))

Solution (Python):



n = input()


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

Solution (Python):
n = input()

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

n = "".join(lst)

print(n)

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


if __name__ == '__main__':
    main()

Solution (Python):
s = input()
s=s.replace('1', 'one')
s=s.replace('9', 'nine')
s=s.replace('nine', '1')
s=s.replace('one', '9')
print(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):
s = input()

print(s.replace('1','2').replace('9','1').replace('2','9'))

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

Solution (Python):
n=int(input())
d=1
for i in range(3):
    x=n//d%10
    if x==1:
        n+=8*d
    elif x==9:
        n-=8*d
    d*=10

print(n)

Solution (Python):
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

N = s()

res = ''
for c in N:
    if c == '1':
        res += '9'
    else:
        res += '1'
print(res)

Solution (Python):
n = input()
p = n.replace("9","a")
q = p.replace("1","b")
r = q.replace("a","1")
s = r.replace("b","9")

print(int(s))

Solution (Python):
n = input()
d = {'1':'9','9':'1'}

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

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

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

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

for num in range(len(n)):
    if n[num] == "1":
        n[num] = "9"
    elif n[num] == "9":
        n[num] = "1"

result = int("".join(n))

print(result)

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

Solution (Python):
n = input()
lists = []
for i in range(3):
    lists.append(n[i])
for i in range(len(n)):
    if lists[i] == "1":
        lists[i] = "9"
    else:
        lists[i] = "1"

n = "".join(lists)
print(int(n))

Solution (Python):
n = input()

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

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=input()
print(s.translate(str.maketrans({'1': '9', '9': '1'})))

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

Solution (Python):
s = int(input())
s = str(s).replace("1","a")
s = s.replace("9","1")
s = s.replace("a","9")

print(s)

Solution (Python):

s = str(input())
ans = ""

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

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

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())
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 = [0]*3
for i,w in enumerate(n):

    if w == '9':
        ans[i] = '1'
    elif w == '1':
        ans[i] = '9'

print("".join(ans))

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

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

print(int(A))

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

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

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

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

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

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

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

Solution (Python):
n = 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')
elif n == '999':
    print('111')

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

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

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):
def abc():
    n = input().rstrip()
    print(n.replace('1', '_').replace('9', '1').replace('_', '9'))


abc()

Solution (Python):
import sys
sys.setrecursionlimit(10**7)
def lmi(): return list(map(int, input().split()))

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):
s = list(map(int, list(input())))

for i in range(3):
    s[i] = 10 - s[i]

print(s[0]*100+s[1]*10+s[2])

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

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

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

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

Solution (Python):
s = input()

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

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

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

print(output)

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

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

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

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

result = ""
for i in range(l):
    result = result+n_list[i]

print(result)

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

n = list(n)

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

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

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

Solution (Python):
n = input()

ls = []

for i in n:
    if i=="1":
        ls.append("9")
    elif i == "9":
        ls.append("1")
    else:
        ls.append(i)

print("".join(ls))

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(input())
for i in range(3) :
        if n[i] == '9':
                n[i] = '1'
        else :
                n[i] = '9'
print(''.join(n))

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

li = []
for i in n:
    if i == '1':
        i = '9'
    elif i == '9':
        i = '1'

    li.append(i)

print("".join(li))

Solution (Python):

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

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

Solution (Python):


n = int(input())

print(1110-n)

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()
for i in n:
    if i == '1':
        print('9',end='')
    elif i == '9':
        print('1',end='')

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

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

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

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

print(s)

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

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

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

print(1110-N)

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

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

Solution (Python):
n = input()
N = []
for v in n:
    N.append(v)
for i in range(len(N)):
    if N[i] == '1':
        N[i] = '9'
    else:
        N[i] = '1'
answer = N[0] + N[1] + N[2]
print(int(answer))

Solution (Python):
a,b,c=input()
def x(n):
  if n=="1":
    n="9"
  else:
    n="1"
  return n
print(x(a)+x(b)+x(c))

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

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

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

swap_dict = dict([['1','9'],['9','1']])

for i in range(len(s)):
  s[i] = swap_dict[s[i]]
  
print(''.join(s))

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

ans = 0
unit = [100, 10, 1]

for x, u in zip(s, unit):
    if x=='1':
        ans += 9 * u
    else:
        ans += 1 * u

print(ans)

Solution (Python):
n=input()

answer=[]

for i in n:
    if i=="9":
        answer.append("1")
    
    else:
        answer.append("9")

print("".join(answer))

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

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

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


print("".join(s))

Solution (Python):

lst_N = list(input())

for i in range(3):

    if lst_N[i] == '9':
        lst_N[i] = '1'
    else:
        lst_N[i] = '9'

N = ''.join(lst_N)
N = int(N)

print(N)

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

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

Solution (Python):
a = {"1":"9","9":"1"}
z = input()
m = ""
for i in z:
  m += a[i]

print(m)

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    for i in s:
        if i == '1':
            print(9, end = '')
        if i == '9':
            print(1, end= '')
    
    print()
    

solve()

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

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

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

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 = list(input())
for num in n:
    if num == '1':
        num ='9'
    elif num == '9':
        num = '1'
    print(num,end='')

Solution (Python):
from sys import stdin

n = stdin.readline().rstrip()
output = ''
for k in n:
    if k == '1':
        output += '9'
    else:
        output += '1'
print(output)

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

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

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

Solution (Python):
n = input()

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

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

Solution (Python):
n = input()

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

print(n)

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.replace('1', 'a').replace('9', 'b').replace('a', '9').replace('b', '1'))

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

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):

import sys


def solve(n: str):
    print(n.replace("9","t").replace("1","9").replace("t","1"))




def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = next(tokens)  
    solve(n)

if __name__ == '__main__':
    main()

Solution (Python):
n = list(input())
r = n.copy()
for i,k in enumerate(n) :
  if k == "1" :
    r[i] = "9"
  elif k == "9":
    r[i] = "1"
print("".join(r))

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

print(ans)

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


if __name__ == "__main__":
    main()

Solution (Python):
s = input().rstrip()
ans = ''
for l in s:
  if l == '9':
    ans += '1'
  elif l == '1':
    ans += '9'
  else:
    ans += l

print(ans)

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

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

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

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

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

Solution (Python):
n = input()
n = list(n)
if n[0] == "1":
    print(9, end='')
if n[0] == str(9):
    print(1, end="")
if n[1] == str(1):
    print(9, end="")
if n[1] == str(9):
    print(1, end="")
if n[2] == str(1):
    print(9)
if n[2] == str(9):
    print(1)

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

Solution (Python):
t = list(input().strip())

for v in t:
  if v =="1":
    print("9", end = "")
  else:
    print("1", end = "")
    
print()

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

Solution (Python):
print(input().translate({49:57,57:49}))

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

Solution (Python):
n = input()

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

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

Solution (Python):

"""
A - AtCoder Beginner Contest 999
https://atcoder.jp/contests/abc111/tasks/abc111_a

"""
import sys


def solve(n):
    return n.translate(str.maketrans('19', '91'))


def main(args):
    n = input()
    ans = solve(n)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
from __future__ import print_function
import numpy as np
import sys
import math,string,itertools,fractions,heapq,collections,re,array,bisect,copy,functools


import random

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)

l = list(input())

for i in range(len(l)):
    if l[i]=='1':
        l[i] = '9'
    else:
        l[i] = '1'
ll = "".join(l)
print(ll)

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

Solution (Python):
if __name__ == '__main__':
    n = str(input())

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

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

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

print(''.join(l))

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

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

for i in range(len(a)):
    if a[i] == '9':
        a[i] = '1'
    else:
        a[i] = '9'

b = ''.join(a)
print(b)

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

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

Solution (Python):
import sys


def input():
    return sys.stdin.readline()[:-1]








a = str(input())
a = a.replace("1", "-")
a = a.replace("9", "1")
a = a.replace("-", "9")
print(a)

Solution (Python):
s = input()
l = ''
for k in s:
  if k == '1':
    l += '9'
  elif k == '9':
    l += '1'
  else:
    l += k
    
print(int(l))

Solution (Python):
n=input()

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

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

Solution (Python):
n = input()
print(n.translate(str.maketrans("19","91")))

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):
n = input()

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

print(num)

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

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

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

Solution (Python):
print(input().translate({ord("1"): "9", ord("9"): "1"}))

Solution (Python):
li = list(input())
ans_num = ""
for num in li:
    if num == "1":
        ans_num += "9"
    elif num == "9":
        ans_num += "1"

print(ans_num)

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

Solution (Python):
s = input()
changer = {"1":"9", "9":"1"}
answer = ""
for chr in s:
    answer += changer[chr] 
print(int(answer))

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

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

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

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

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

print()

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(N[0] + N[1] +N[2])

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

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

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

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

Solution (Python):
P=input()
p=[]
for i in range(3):
    if P[i]=='1':
        p.append('9')
    else:
        p.append('1')

print(''.join(p))

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