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):
a=list(input())
for i,j in enumerate(a):
        if j=="9":
            a[i]="1"
        else:
            a[i]="9"
print("".join(a))

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

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

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

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

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

apple = []



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

count = 0
m = 0
for i in apple:
    i = int(i)
    if count == 0:
        i *= 100
        m += i
        count += 1
    elif count == 1:
        i *= 10
        m += i
        count += 1
    elif count == 2:
        m += i

print(m)

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

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

Solution (Python):
a=list(input())
for i,j in enumerate(a):
    if j=="9":
        a[i]="1"
    else:
        a[i]="9"
print("".join(a))

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

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

Solution (Python):
num = input()

n1 = 10 - int(num[0])
n2 = 10 - int(num[1])
n3 = 10 - int(num[2])

print(n1,n2,n3,sep='')

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

Solution (Python):

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

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

print(moji)

Solution (Python):

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = list(sr())
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 i in range(3):
    if n[i]=="1":
        n[i]="9"
    else:
        n[i]="1"
print("".join(n))

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

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

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

Solution (Python):


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

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

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

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

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

Solution (Python):
def resolve():
    n=input()
    n_1=n.replace('1','a')
    n_2=n_1.replace('9','1')
    n_3=n_2.replace('a','9')
    print(n_3)
resolve()

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

Solution (Python):
s = input()

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

print("")

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

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

Solution (Python):
List = list(input())
for i in range(len(List)):
    if int(List[i]) == 1:
        List[i] = str('9')
    else:
        List[i] = str('1')

print(''.join(List))

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

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

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 accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

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

print(1110-n)

Solution (Python):
def main():
    n = list(input())
    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):
a = list(input())
for i in range(3):
    if a[i] == "1":
        a[i] = "9"
    else:
        a[i] = "1"
print("".join(a))

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

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

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

Solution (Python):
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()

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

Solution (Python):
n = 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):
n = input()
ans = ''
for i in range(3):
    if n[i] == '1':
        ans += '9'

    elif n[i] == '9':
        ans +=  '1'
    
    else:
        ans += n[i]

print(ans)

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

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

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

print(ans)

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 = ""
for i in N:
    if i == "9":
        ans += "1"
    elif i == "1":
        ans += "9"
    else:
        ans += i
print(ans)

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

for i in range(n):
  print(s[i],end='')

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

Solution (Python):
n = input()

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

Solution (Python):
n = input()

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

Solution (Python):
n = input()

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

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

Solution (Python):
import sys
def input():
    return sys.stdin.readline()[:-1]
S = input()
S = S.replace('1','x')
S = S.replace('9','1')
S = S.replace('x','9')
print(S)

Solution (Python):
INF = 10 ** 9
import sys
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from  collections import deque

def main():
    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))
if __name__ == '__main__':
    main()

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

print(int(ans))

Solution (Python):
S = str(input())
print( 100*(10-int(S[0])) + 10*(10-int(S[1])) + 1*(10-int(S[2])) )

Solution (Python):



str = input()
ans = ""

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

print(ans)

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

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

Solution (Python):
N = input()
res = ""

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

Solution (Python):
n = input()

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

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

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

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

Solution (Python):
n=list(input())
if n[0]=="1":
  n[0]="9"
else:
  n[0]="1"
if n[1]=="1":
  n[1]="9"
else:
  n[1]="1"
if n[2]=="1":
  n[2]="9"
else:
  n[2]="1"
print("".join(n))

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

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


def solve():

    n = list(map(int, input()))
    for i in n:
        if i == 9:
            print(1, end="")
        else:
            print(9, end="")

    print()


if __name__ == "__main__":
    solve()

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

Solution (Python):
n = input()

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

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

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

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

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

Solution (Python):
n = input()
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'
    else: ans += '1'
print(ans)

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

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

Solution (Python):
icase=0
if icase==0:
    k=int(input())
    print(1110-k)

Solution (Python):
n=input()

x =""

for i in n:
    if i == "1":
        x += "9"
    else:
        x += "1"
print(int(x))

Solution (Python):
import math
import collections
import sys


def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]

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

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

Solution (Python):
l = [i for i in input()]
m = ""
for i in l:
  if i == "1":
    m += "9"
  else:
    m += "1"
print(int(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 = input()
print(n.replace("1", "x").replace("9", "1").replace("x", "9"))

Solution (Python):

n = input()
ans = ""

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

Solution (Python):
n = input()

r = {'1': '9', '9': '1'}

ans = ''

for i in n:
    ans += r[i]

print(ans)

Solution (Python):
import sys
import os
import math

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    S = list(iss())
    print("".join(["1" if s == "9" else "9" for s in S]))


if __name__ == '__main__':
    main()

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

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

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):
s = input()
for c in s:
    print('9' if c == '1' else '1', end='')

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

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

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

Solution (Python):
num = input()
lis = ""

for i in num:
    if i == "1":
        lis+="9"
    else:
        lis+="1"

print(int(lis))

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

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

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

Solution (Python):
def Atcoder999(n):

    return n.replace("9" , "5").replace("1" , "9").replace("5" , "1")

def main():
    n = str(input())
    print(Atcoder999(n))

if __name__ == '__main__':
    main()

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

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

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

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

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

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

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

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

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

Solution (Python):
N = int(input())
A = []
a = N//100
b = N//10-a*10
c = N - a*100 - b*10
A.append(a)
A.append(b)
A.append(c)
for i in range(3):
    if A[i]==1:
        A[i]=9
    elif A[i]==9:
        A[i]=1
print(A[0]*100+A[1]*10+A[2])

Solution (Python):
n = input()

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

print(out)

Solution (Python):
n = input()

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

Solution (Python):
a=input()

ans=[]

for i in a:
    if i=="1":
        ans.append("9")
    else:
        ans.append("1")
print("".join(ans))

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

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

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

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

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

Solution (Python):
import sys
import os

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = iss()
    N = N.replace('1', 'b')
    N = N.replace('9', '1')
    N = N.replace('b', '9')
    print(N)


if __name__ == '__main__':
    main()

Solution (Python):

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

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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 = str(input())
num = list(n)

for i in range(0, 3):
  if num[i] == '9':
    num[i] = 1
  if num[i] == '1':
    num[i] = 9

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

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

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

Solution (Python):
n=input()

N=list(n)

A=[]

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

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

Solution (Python):
n = input()

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

print(ans)

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

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

for j in range(3):
  print(n[j], end="")

Solution (Python):
a = input()
b_dic = {'1':'9', '9':'1'}
c=''
for i in range(3):
     c+=b_dic[a[i]]
    
print(c)

Solution (Python):
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect




from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  n = input()
  ans = ''
  for i in range(len(n)):
    if n[i]=='1':
      ans += '9'
    else:
      ans += '1'
  print(ans)
  
  
  
  
if __name__ == '__main__':
  main()

Solution (Python):

n = input()
result = n.replace('1', 'a').replace('9', '1').replace('a', '9')
print(result)

Solution (Python):
def main():
  n = list(input())
  
  
  
  
  
  
  
  ans = 0
  count = 0
  lis = []
  
  for i in range(len(n)):
    if n[i] == "1":
      n[i] = "9"
    elif n[i] == "9":
      n[i] = "1"
  print("".join(n))

if __name__ == '__main__':
  main()

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

tmp = ''
for i in range(3):
    if n[i] == '1':
        tmp += '9'
    elif n[i] == '9':
        tmp += '1'
    
print(tmp)

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

if n[0] == "1":
    n[0] = "9"
else:
    n[0] = "1"
if n[1] == "1":
    n[1] = "9"
else:
    n[1] = "1"
if n[2] == "1":
    n[2] = "9"
else:
    n[2] = "1"
print("".join(n))

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

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate
    
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    

    
    mod = 10**9 + 7

    n = input().rstrip()
    s = ''
    for i in n:
        if i=='1':
            s += '9'
        else:
            s += '1'
    print(s)

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
import sys

n = sys.stdin.readline().rstrip()

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

if __name__ ==  '__main__':
    main(n)

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

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

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

if n//100==9:
    n-=800
else:
    n+=800

if (n%100)//10==9:
    n-=80
else:
    n+=80

if n%10==9:
    n-=8
else:
    n+=8

print(n)

Solution (Python):
print(*list(map(lambda x: "9" if x=="1" else "1", input())),sep="")

Solution (Python):
n = input()
ans = ''
for i in range(3):
    if n[i] == '1':
        ans += '9'
    elif n[i] == '9':
        ans += '1'
    else:
        ans += str(n[i])
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):
import sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

if __name__ == '__main__':
    a = input()
    ans =""
    
    for i in a:
        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 = str(input())

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

print("".join(res))

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):
n = input()
ans = ''
for i in n:
    if i == '1':
        ans += '9'
    else:
        ans += '1'

print(ans)

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

Solution (Python):
s = input()
s = list(s)
if s[0] == '1':
  s[0] = '9'
else:
  s[0] = '1'
if s[1] == '1':
  s[1] = '9'
else:
  s[1] = '1'
if s[2] == '1':
  s[2] = '9'
else:
  s[2] = '1'

print(''.join(s))

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

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

Solution (Python):
S=input()

answer=""

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

print(answer)

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

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

Solution (Python):


n = input()

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

Solution (Python):


n = input()

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

Solution (Python):
n = input()


answer = 0
if n[0] =="1":
	answer = answer + 900
else:
    answer = answer + 100

if n[1] =="1":
	answer = answer + 90
else:
	answer = answer + 10

if n[2] =="1":
	answer = answer + 9
else:
	answer = answer + 1

print(answer)

Solution (Python):
s = input()

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

Solution (Python):
import sys
from bisect import *
from heapq import *
from collections import *
from itertools import *
from functools import *
from math import *
from fractions import *

sys.setrecursionlimit(100000000)
input = lambda: sys.stdin.readline().rstrip()


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

main()

Solution (Python):
n = input()
n = n.replace("1", "x")
n = n.replace("9", "1")
print(n.replace("x", "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"
ans = "".join(N)
print(ans)

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

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

Solution (Python):
ans = ""
for s in input():
  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):
a = {"1":"9","9":"1"}
inp_num = input()
ans = ""
for i in inp_num:
  ans += a[i]
print(ans)

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

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

Solution (Python):

N = input().strip()

print(''.join(['1' if c == '9' else '9' for c in N]))

Solution (Python):

n = input()


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

print(ans)

Solution (Python):

n = input()


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

print(ans)

Solution (Python):



n = int(input())


if n%10 == 1:
    a = 9
else:
    a = 1

n = n//10

if n%10 == 1:
    b = 9
else:
    b = 1

n = n//10

if n == 1:
    c = 9
else:
    c = 1

ans = 100*c + 10*b + a

print(ans)

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

Solution (Python):

n = int(input())
s = str(n)

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

print()

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

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

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

ans = ""
for val in n:
    if val == "1":
        ans += "9"
    elif val == "9":
        ans += "1"
    else:
        ans += val

print(ans)

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

print(1110-n)

Solution (Python):
n=input()

if n[0]=="1":
  ans="9"
  
else:
  ans="1"
  
if n[1]=="1":
  ans+="9"
  
else:
  ans+="1"
  
if n[2]=="1":
  ans+="9"
  
else:
  ans+="1"
  
print(ans)

Solution (Python):
n = input()

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

print(n)

Solution (Python):
n = list(input())
d100 = int(n[0])
d10 = int(n[1])
d1 = int(n[2])

if d100 == 1:
    d100 = 9
elif d100 == 9:
    d100 =1

if d10 == 1:
    d10 = 9
elif d10 == 9:
    d10 = 1

if d1 == 1:
    d1 = 9
elif d1 == 9:
    d1 = 1

n = d100*100 + d10*10 + d1
print(n)

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

Solution (Python):
S = input()
for c in S: print(chr(ord(c) ^ ord('1') ^ ord('9')), end='')
print()

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

Solution (Python):
s = input()

print(s.replace("9", "-").replace("1", "9").replace("-", "1"))

Solution (Python):
n = input()

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

Solution (Python):
n = input()

ans = []

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

print(''.join(ans))

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

for i in range(3):
    if s[i] == "1":
        ans = ans + "9"
    else:
        ans = 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'

print(''.join(s))

Solution (Python):

a = input()
print(a .replace('9' , 'r').replace('1' , '9').replace('r' , '1'))

Solution (Python):

a = input()
a = a .replace('9' , 'r')
a = a .replace('1' , '9')
a = a .replace('r' , '1')
print(a)

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

Solution (Python):
d = {'1':'9','9':'1'}
s = input()
print(d[s[0]]+d[s[1]]+d[s[2]])