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

Solution (Python):


n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n.pop(i)
        n.insert(i, "9")
    elif n[i] == "9":
        n.pop(i)
        n.insert(i,"1")
print(int("".join(n)))

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

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

print(s)

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

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

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

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

if n%10==1:
    n+=8
else:
    n-=8
print(n)

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

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

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

Solution (Python):
n = input()

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

print(int(n))

Solution (Python):

url = "https://atcoder.jp//contests/abc111/tasks/abc111_a"

def main():
    s = input()
    print(s.translate(str.maketrans({'1': '9', '9': '1'})))
    
    
if __name__ == '__main__':
    main()

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

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

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

print(''.join(map(str, new_list)))

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()
i=0
a=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=1
b=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=2
c=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
print(a+b+c)

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

Solution (Python):
a = input()
l1 = []
l2 = []
for i in range(len(a)):
  l1.append(a[i:i+1])
for i in range(len(a)):
  l2.append(str(abs(int(l1[i]) - 10)))
print("".join(l2))

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

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

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

t = ''
for i in range(3):
  t += s[i]
  
print(t)

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

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

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

n = ir()
print(1110-n)

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

Solution (Python):
f = lambda c : "1" if c == "9" else "9"
  
print(''.join(list(map(f, input()))))

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):
moji = str(input())
ans = ""
for i in range(len(moji)):
    ans += ("1","9")[moji[i]=="1"]
print(ans)

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

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

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


main()

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


if __name__ == '__main__':
    main()

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

Solution (Python):
n = input()
for c in n:
  print(10-int(c),end='')
print()

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

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

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

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

for i in range (0, len(a)):
    if a[i] == "1":
        a[i] = "9"
    elif a[i] == "9":
        a[i] = "1"
    print(a[i], end = "")

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

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

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

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

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

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

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

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

print(1110 - n)

Solution (Python):
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()
ans = ""
for ch in n:
    if ch == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

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

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

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

print(ans)

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

Solution (Python):
n = input()
ans = ""
for i in range(3):
    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):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n = S()
    ans = ''
    for c in n:
        if c == '1':
            ans += '9'
        elif c == '9':
            ans += '1'
        else:
            ans += c
    print(ans)


main()

Solution (Python):
n = input()

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

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

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

for j in range(3):
  S+=n[j]
print(S)

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

print(result)

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

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

Solution (Python):
n = input()
n01 = n.replace('1', 'x')
n02 = n01.replace('9', 'y')
n03 = n02.replace('x', '9')
n04 = n03.replace('y', '1')
print(n04)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = input()

    res = ""
    for x in n:
        res += "9" if x == "1" else "1"

    print(res)


if __name__ == '__main__':
    main()

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

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

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

print(ans)

Solution (Python):
s = list(input())
def slv(i):
    if i == 1 or i == 9:
        return 10-i
    else:
        return i
print(str(slv(int(s[0])))+str(slv(int(s[1])))+str(slv(int(s[2]))))

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

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

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

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

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

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

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

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

Solution (Python):
a = input()

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

print(a)

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

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

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

Solution (Python):

import sys
import numpy as np
import math


sList = list(str(input()))
for i in range(3):
	if sList[i] == "1":
		sList[i] = "9"
	else:
		sList[i] = "1"

print("".join(sList))

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

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

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

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

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

Solution (Python):



def main():
    N = input()

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


if __name__ == "__main__":
    main()

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

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

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

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

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

Solution (Python):
n=input()

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

print(''.join(ans))

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

Solution (Python):
S = input()

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

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(''.join(ans))

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

Solution (Python):
n = input()

m = ""

for x in n:
    if x == "1":
        m += "9"
    elif x == "9":
        m += "1"
    else:
        m += x

print(int(m))

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    n = readline().strip()
    print(n.translate(n.maketrans('19', '91')))

    return


if __name__ == '__main__':
    main()

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

Solution (Python):










n = input()

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

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

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

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

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

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

Solution (Python):
import sys


stdin = sys.stdin
def ns(): return stdin.readline().rstrip()
def ni(): return int(stdin.readline().rstrip())
def nm(): return map(int, stdin.readline().split())
def nl(): return list(map(int, stdin.readline().split()))


def switch(n):
    if n == '1':
        return '9'
    elif n == '9':
        return '1'
    else:
        return n


def main():
    N = ns()
    ans = ''
    for n in N:
        ans += switch(n)
    print(ans)


if __name__ == '__main__':
    main()

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

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

Solution (Python):


def main():
    n = input()
    result = []
    for i in n:
        if i == '1':
            result.append('9')
        elif i == '9':
            result.append('1')
        else:
            result.append(i)
    print(result[0] + result[1] + result[2])


if __name__ == "__main__":
    main()

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

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

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

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

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

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

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()
l = []
for i in n:
    if i == "1":
        l.append("9")
    elif i == "9":
        l.append("1")

print(''.join(l))

Solution (Python):
n = input()

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

Solution (Python):
n = input()
n = n.replace('1','a').replace('9','1').replace('a','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 = input()
ans = ""
for i in n:
  if i =="1":
    ans += "9"
  else:
    ans += "1"
print(ans)

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

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

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

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

Solution (Python):
if __name__ == '__main__':
	
	N = input()
	
	s = ""
	for i in N:
		if i == "1":
			s += "9"
		elif i == "9":
			s += "1"
	
	print(s)

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

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

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

print(int(ans))

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

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

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

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

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

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

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

print("".join(l))

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

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

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

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

Solution (Python):







































def calculation(lines):
    
    
    n = lines[0]

    return [n.replace('9', 'a').replace('1', '9').replace('a', '1')]



def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines



def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['119']
        lines_export = ['991']
    if pattern == 2:
        lines_input = ['999']
        lines_export = ['111']
    return lines_input, lines_export



def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode



def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    
    
    
    
    
    
    
    
    
    
    



if __name__ == '__main__':
    main()

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = readline().decode().rstrip()

n = n.replace('1', 't').replace('9', '1').replace('t', '9')
print(int(n))

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    n = input().rstrip()

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
n = input()

ans = ''

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

Solution (Python):

import sys

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

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

print(1110-n)

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

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

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

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

Solution (Python):
N = int(input())
l = []
for s in str(N):
    if s == '1':
        l.append('9')
    elif s == '9':
        l.append('1')
    else:
        l.sppend(s)
print(''.join(l))

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

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

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

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

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

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

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

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

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

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
import sys

def LS2(): 
    return list(sys.stdin.readline().rstrip())  

n = LS2()

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

print(''.join(n))

Solution (Python):
n = input()
print(n.replace('1','X').replace('9','1').replace('X','9') if "1"or'9' in n else n)

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

n_str = list(str(n))

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

print(int("".join(n_str)))

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

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

Solution (Python):
import sys
n = list(input())
int_n = int(''.join(n))
if not (111 <= int_n <= 999):
    sys.exit()

result = []
for I in n:
    if I == '1':
        result.append('9')
    elif I == '9':
        result.append('1')
    else:
        result.append(I)
print(int(''.join(result)))

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

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

Solution (Python):
t = input()

ans = ""

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

print(ans)

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

    if s == "1":
        ans += "9"
        continue

    ans += s
    
print(ans)

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

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

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

if __name__ == "__main__":
    main()

Solution (Python):
import sys

rr = lambda: sys.stdin.readline().rstrip()
print(rr().translate(str.maketrans('19', '91')))

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

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

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

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

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

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

Solution (Python):
n = input()

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

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

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

if '__main__' == __name__:
    resolve()

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

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 n:
    print(j, end = "")

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

Solution (Python):
n = input()

ans = ""

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