Problem:
 Score : 100 points    Problem Statement Cat Snuke is learning to write characters.
Today, he practiced writing digits 1 and 9 , but he did it the other way around.  You are given a three-digit integer n written by Snuke.
Print the integer obtained by replacing each digit 1 with 9 and each digit 9 with 1 in n .      Constraints  111 \leq n \leq 999  n is an integer consisting of digits 1 and 9 .         Input Input is given from Standard Input in the following format:  n       Output Print the integer obtained by replacing each occurrence of 1 with 9 and each occurrence of 9 with 1 in n .        Sample Input 1 119      Sample Output 1 991  Replace the 9 in the ones place with 1 , the 1 in the tens place with 9 and the 1 in the hundreds place with 9 . The answer is 991 .       Sample Input 2 999      Sample Output 2 111

Solution (Python):


n = list(str(int(input())))

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

for i in n:
    print(i, end="")

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

print(''.join(M))

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

Solution (Python):
n = str(input())
dix = {'1':'9','9':'1'}
ans = ""
for x in n:
  if x=='1' or x=='9':
    ans += dix[x]
  else:
    ans += x
print(ans)

Solution (Python):
n=input()


ans=""

if n[0]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

if n[1]=="1":
	ans=ans+"9"
else:
	ans=ans+"1" 

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


print(ans)

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

Solution (Python):
n = input()



if n[0] == "1":
    a = 9
elif n[0] == "9":
    a = 1

if n[1] == "1":
    b = 9
elif n[1] == "9":
    b = 1

if n[2] == "1":
    c = 9
elif n[2] == "9":
    c = 1

d = a*100 + b*10 + c


print(d)

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

Solution (Python):
n = input().rstrip()
d = {'1': '9', '9': '1'}
m = ''
for i in range(len(n)):
    m += d.get(n[i], n[i])
print(m)

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

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

Solution (Python):
import sys, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict



sys.setrecursionlimit(10000000)

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

lcm = lambda x, y: (x * y) // math.gcd(x, y)


MOD = 10 ** 9 + 7
MAX = float('inf')


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

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


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
n = input()

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

Solution (Python):
def solve():
    print(input().replace('1', '8').replace('9', '1').replace('8', '9'))

if __name__ == '__main__':
    solve()

Solution (Python):


n = int(input())

print(1110 - n)

Solution (Python):
def solve():
    print(input().replace('1', '8').replace('9', '1').replace('8', '9'))



if __name__ == '__main__':
    solve()

Solution (Python):
n = input()
print(*[1 if a=='9' else 9 for a in n], sep="")

Solution (Python):
n = input()

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

print(ans)

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

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

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

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

Solution (Python):
def replace1and9(x):
  if x == '9':
    return '1'
  if x == '1':
    return '9'

n = input()
ans = ""
for i in n:
  ans += replace1and9(i)
print(ans)

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

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

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

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

Solution (Python):
n = input()
ans = ''
for i in n:
    if i == '1':
        ans += '9'
    elif i == '9':
        ans += '1'
print(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=input()
ans=[]
for i in range(len(N)):
  if N[i]=="1":
    ans.append(9)
  else:
    ans.append(1)
print(*ans,sep="")

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

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

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

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

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

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

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

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

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

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

Solution (Python):
a,b,c = input()

d = {"1":"9", "9":"1"}
print(d[a]+d[b]+d[c])

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

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

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

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

Solution (Python):
n = input()
for c in n:
    if c == '9':
        print('1', end='')
    elif c == '1':
        print('9', end='')
    else:
        print(c, 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(int(ans))

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

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

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

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

print(1110 - n)

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

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

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

Solution (Python):
n = input()

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

Solution (Python):
def resolve():
    N = input()
    N = N.replace("9", "0")
    N = N.replace("1", "9")
    N = N.replace("0", "1")
    print(N)


resolve()

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(3):
    
    if n[i]=='1':
        n[i]='9'
    else:
        n[i]='1'

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

Solution (Python):
N = list(map(int, list(input())))
for i in range(3):
  N[i] = 10 - N[i]

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

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

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

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

Solution (Python):
N = input()
N = list(N)
res = []
for n in N:
    if n is '1':
        res.append('9')
    else:
        res.append('1')

print(''.join(res))

Solution (Python):
n = input()

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

Solution (Python):
n = input()

print(''.join('9' if c == '1' else '1' for c in n))

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

Solution (Python):
m=input()
def s(x):
  if x=='1':
    return '9'
  else:
    return '1'
print(s(m[0])+s(m[1])+s(m[2]))

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

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

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


print(n)

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

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

print(''.join(n))

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):
import sys, re
from math import ceil, floor, sqrt, pi, factorial
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_list(N): return [s_list() for _ in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    n = i_input()
    
    str_n = str(n)

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

if __name__ == '__main__':
    main()

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

Solution (Python):
n = input()

mapping_table = str.maketrans({'1': '9', '9': '1'})

print(n.translate(mapping_table))

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

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

print (ans)

Solution (Python):
n=input()

n_out=''

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

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

while i < 3:
    if n[i] == '1':
        n[i] = '9'
        i = i + 1
    else:
        n[i] = '1'
        i = i + 1

print(''.join(n))

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

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

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

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

print(ans)

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

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

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

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

Solution (Python):
n = input()

s = list(n)

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

print(''.join(s))

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

Solution (Python):

import sys
input = sys.stdin.readline









N = input().rstrip()

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

print(ans)

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

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

Solution (Python):
n = int(input())
for i in reversed(range(3)):
    if str(n)[-1*i - 1] == '1':
        n += 8*10**i
    elif str(n)[-1*i - 1] == '9':
        n -= 8*10**i
print(n)

Solution (Python):
S = input()
N = len(S)
T = ""
for i in range(N):
    if S[i] == "1":
        T += "9"
    elif S[i] == "9":
        T += "1"
    else:
        T += S[i]
print(int(T))

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

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

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

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

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

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

Solution (Python):

n=list(input())

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

    else:n[i]='1'

L=[str(a) for a in n]
L="".join(L)
print(L)

Solution (Python):
n = list(input())
num = ['1', '9']
[print(num[num.index(i)-1], end='') for i in 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=input()
result=''
n=str(n)
for i in n:
    if i=='9':
        result+='1'
    elif i=='1':
        result+='9'
print(result)

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

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

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

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

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

Solution (Python):
s = input()

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

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

Solution (Python):

n = list(input())

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

print(op)

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


def main():
    n = input()
    ans = ""
    for i in n:
        if i == '1': ans += '9'
        if i == '9': ans += '1'
    print(int(ans))



if __name__ == "__main__":
    main()

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

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 = input()
m = n.replace("1", "x")
y = m.replace("9", "1")
print(y.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'
print(''.join(n))

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

print(ans)

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

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

if n[0] == "9":
  ans = 100
elif n[0] == "1":
  ans = 900
  
if n[1] == "9":
  ans = ans + 10
elif n[1] == "1":
  ans = ans + 90

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

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

print(int("".join(x)))

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

Solution (Python):
s=input()
n=len(s)
q="1"*n+"0"
print(int(q)-int(s))

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

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

    res = ''

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

if __name__ == '__main__':
    main()

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

for i in n:
	if i == "1":
		output.append("9")
	elif i =="9":
		output.append("1")
	else:
		output.append(i)
		
print("{}{}{}".format(output[0],output[1],output[2]))

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

ans = 1110 - n
print(ans)

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

Solution (Python):


n = input()
x = n.replace('1', 'm')
y = x.replace('9', '1')
z = y.replace('m', '9')
print(z)

Solution (Python):
n=input()

N=[]

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

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

Solution (Python):
import itertools
import math
import fractions
import functools
import copy

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

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

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

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

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

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

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

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18


n = S()
ans = []
for c in n:
    if c == '1':
        ans.append('9')
    else:
        ans.append('1')
print("".join(ans))

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = S()
ans = list()
for c in N:
    if c == '1':
        ans.append('9')
    else:
        ans.append('1')
print(''.join(ans))

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

Solution (Python):
n=str(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(len(n)):
    if n[i] == "9":
        n[i] = "1"
    elif n[i] == "1":
        n[i] = "9"
print("".join(n))

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

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

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

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

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

Solution (Python):
s = input()

if s[0] == '1':
  s = '9' + s[1:]
elif s[0] == '9':
  s = '1' + s[1:]
  
if s[1] == '1':
  s = s[0] + '9' + s[2]
elif s[1] == '9':
  s = s[0] + '1' + s[2]

if s[2] == '1':
  s = s[:2] + '9'
elif s[2] == '9':
  s = s[:2] + '1'
print(s)

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

Solution (Python):
s = input()

t = ""

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

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

Solution (Python):
import sys
import math
import bisect

def main():
    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))

if __name__ == "__main__":
    main()

Solution (Python):
table = {
    '1': '9',
    '9': '1',
}

S = input()

for c in S:
    print(table[c], end='')
print('')

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

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

Solution (Python):
inf = 10**15
mod = 10**9+7

n = input()
ans = ''
for c in n:
    if c == '1':
        ans = ''.join([ans, '9'])
    else:
        ans = ''.join([ans, '1'])
print(ans)

Solution (Python):


import sys






















def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = input()
    n = n.replace('1', '
    print(n)



if __name__ == "__main__":
    main()

Solution (Python):
n=input()
a=n[0]
b=n[1]
c=n[2]
print(abs(int(a)-10)*100+abs(int(b)-10)*10+abs(int(c)-10))

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

    

if __name__ == '__main__':

    ABC_111_A()

Solution (Python):
N=int(input())
ans=0
for i in range(3):
  n=N%10
  N=N//10
  ans+=10**i*((n+8)%16)
print(ans)

Solution (Python):
import itertools
import math
import fractions
import functools
n = input()
ans = []

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

Solution (Python):
import itertools
import math
import fractions
import functools
n = input()
ans = []

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n=int(input())
ans=0
a=n//100
b=n//10-(a*10)
c=n%10
if a==1:
    ans+=900
else:
    ans+=100
if b==1:
    ans+=90
else:
    ans+=10
if c==1:
    ans+=9
else:
    ans+=1
print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

'''
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 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())

if n[0] == "1": n[0] = "9"
elif n[0] == "9": n[0] = "1"
    
if n[1] == "1": n[1] = "9"
elif n[1] == "9": n[1] = "1"
    
if n[2] == "1": n[2] = "9"
elif n[2] == "9": n[2] = "1"

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

Solution (Python):


n = input()
ans = ""

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

print(ans)

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

Solution (Python):

n = input()
a = []
for i in range(len(n)):
  if n[i] == "1":
    a.append("9")
  elif n[i] == "9":
    a.append("1")
  else:
    a.append(n[i])
print("".join(a))

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

Solution (Python):

import sys


def solve(n: int):
    sn = str(n)
    print(sn.translate({ord("1"): "9", ord("9"): "1"}))


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


if __name__ == '__main__':
    main()

Solution (Python):
n = ''
for i in input():
    if i == '1':
        n += '9'
    elif i == '9':
        n += '1'
    else:
        n += i
print(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(''.join(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()
ans=100*(10-int(n[0]))+10*(10-int(n[1]))+(10-int(n[2]))
print(ans)