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

Solution (Python):
n = input()

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

print('')

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

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

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

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

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

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

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

Solution (Python):
n = input()

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

print(int(n))

Solution (Python):
n = input()

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

print(n)

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

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

Solution (Python):
print(''.join(list(map(lambda x:['1','9'][x=='1'],list(input())))))

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

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

s = str(lst[0]) + str(lst[1]) + str(lst[2])
print (s)

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

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

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

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

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

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

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

Solution (Python):


import sys
from bisect import bisect_left as binl
from copy import copy, deepcopy

def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance





def main():
    n = input()

    for i in n:
        if i == '1':
            sys.stdout.write('9')
        if i == '9':
            sys.stdout.write('1')
    print()


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
def solve():
    inp = list(raw_input())
    for i in range(len(inp)):
        if inp[i] == '1':
            inp[i] = '9'
        elif inp[i] == '9':
            inp[i] = '1'
    print ''.join(inp)

if __name__ == '__main__':
    solve()

Solution (Python):


from sys import stdin

n = stdin.readline().rstrip()

def main():
    ans = ""
    
    for _ in range(len(n)):
        if n[_] == '1':
            ans = ans + '9'
        else:
            ans = ans + '1'
    
    print(ans)

if __name__ == '__main__':
    main()

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

Solution (Python):
num = input()
correct = ""
for x in num:
    if x == "1":
        correct += "9"
    elif x == "9":
        correct += "1"
    else:
        correct += x

print(correct)

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

Solution (Python):
s = input()

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

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

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

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

n = list(input())

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):
x = list(input())
for i in range(3):
  if x[i] == "9":
    print(1,end="")
  else:
    print(9,end="")
print("")

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

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

Solution (Python):
a = input()
b = []
c = []
for i in (a):
    b.append(i)
for v in (b):
    if v == '1':
        c.append('9')
    if v == '9':
        c.append('1')
ans = ''.join(c)
print(ans)

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

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

print(a.translate(table))

Solution (Python):
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import sys

sys.setrecursionlimit(10000)
INF = float('inf')

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

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

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

print(''.join(res))

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

Solution (Python):

import sys
from math import *
from itertools import *
from collections import *
from functools import *
try:
    from math import gcd
except Exception:
    from fractions import gcd


def solve(n: str):
    res = []
    for c in n:
        res.append('9' if c == '1' else '1')
    return int(''.join(res))


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

if __name__ == '__main__':
    main()

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

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

Solution (Python):
n=input()
n=list(n)
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"
ans=int("".join(n))
print(ans)

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

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

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

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

Solution (Python):
n=input()
n=list(n)
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'
ans=int("".join(n))
print(ans)

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

Solution (Python):
s = input();

ans = "";

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

Solution (Python):
n = input()

ans = []
for s in n:
    if s is  '9':
        ans.append('1')
    else:
        ans.append('9')
print(''.join(ans))

Solution (Python):
n = input()

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

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

print(111 + 999 - n)

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

Solution (Python):
n = input()

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

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

Solution (Python):
import bisect
from collections import Counter
def MI(): return map(int, input().split())
def II(): return int(input())
def IS(): return input()
def LI(): return list(map(int, input().split()))


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

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

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

print(''.join(s))

Solution (Python):
n=int(input())
n_100=n//100
n_10=(n-n_100*100)//10
n_1=(n-n_100*100-n_10*10)
if n_100==1:
    ans_100=9
elif n_100==9:
    ans_100=1
else:
    ans_100=n_100
if n_10==1:
    ans_10=9
elif n_10==9:
    ans_10=1
else:
    ans_10=n_10
if n_1==1:
    ans_1=9
elif n_1==9:
    ans_1=1
else:
    ans_1=n_1
ans=ans_100*100+ans_10*10+ans_1
print(ans)

Solution (Python):
S = input().rstrip()
answer = ""
for i in range(3):
  answer += "1" if S[i]=="9" else "9"
print(answer)

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

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

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

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

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

Solution (Python):
import functools
import math

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


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


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


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

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

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

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

n_s=''.join(n)

print(n_s)

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

Solution (Python):
n=input()

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

Solution (Python):


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


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
s = str(n)
c = []

for i in range(len(s)):
  if s[i] == '1':
    c.append('9')
  else:
    c.append('1')

print(''.join(c))

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

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

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

Solution (Python):

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

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

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

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

Solution (Python):
n = str(input())
m = []
for i in range(3):
    m.append(n[i])
    if m[i] == '1':
        m[i] = '9'
    elif m[i] == '9':
        m[i] = '1'
        
nstr = ""        
for i in range(3):
    nstr += m[i]
    
print(nstr)

Solution (Python):

import sys


def solve(n: int):
    ret = ''
    for i in range(len(n)):
        if n[i] == '1':
            ret += '9'
        else:
            ret += '1'
    print(ret)
    return


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

if __name__ == '__main__':
    main()

Solution (Python):

import sys


def solve(n: str):
    a = []
    for c in n:
        a.append("1" if c == "9" else "9")
    print("".join(a))

    return



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


if __name__ == '__main__':
    main()

Solution (Python):
n, = (int(x) for x in input().split())

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

print(ans)

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

Solution (Python):


print(1110 - int(input()))

Solution (Python):
s=list(input())
ret = ""
for val in s:
    if val == "1":
        ret += "9"
    elif val == "9":
        ret += "1"
    else:
        ret += val
print(ret)

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

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

Solution (Python):
S = input()
c = ''
if S[0] == '1':
  c += '9'
elif S[0] == '9':
  c += '1'
else:
  c += S[0]
if S[1] == '1':
  c += '9'
elif S[1] == '9':
  c += '1'
else:
  c += S[1]
if S[2] == '1':
  c += '9'
elif S[2] == '9':
  c += '1'
else:
  c += S[2]
print(c)

Solution (Python):

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

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

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

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

Solution (Python):
n = str(input())
list_n = [int(n[0]),int(n[1]),int(n[2])]

for i in range(len(list_n)):
    if list_n[i] == 1:
        list_n[i] = 9
    elif list_n[i] == 9:
        list_n[i] = 1
    else:
        pass

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

Solution (Python):
s = input()

a = []
for i in range(3):
  if s[i:i+1] == '1':
    a.append('9')
  elif s[i:i+1] == '9':
    a.append('1')
  else:
    a.append(s[i:i+1])

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

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

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

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

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

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

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

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

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

Solution (Python):
a = list(input())
a = [int(x) for x in a]

a2 = [1 if i == 9 else 9 for i in a]

for i in range(len(a2)):
    print(a2[i], end="")

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

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

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

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

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

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

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

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

Solution (Python):

import sys
import copy
from bisect import bisect_left

def main():
	N = list(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()
print(n.replace('1','x').replace('9','1').replace('x',"9"))

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

Solution (Python):
*S, = map(lambda x:"1"if x=="9"else"9", input())
print("".join(S))

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

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

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

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

Solution (Python):
n = int(input())
a = int(n/100)
b = int((n-a*100)/10)
c = int(n-a*100-b*10)
ans = (10-a)*100+(10-b)*10+(10-c)
print(ans)

Solution (Python):
n = input()
a = 1 if n[0] == '9' else 9
b = 1 if n[1] == '9' else 9
c = 1 if n[2] == '9' else 9
print(a * 100 + b * 10 + c)

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

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

Solution (Python):
N = input()

N = N.replace('1', 'x')
N = N.replace('9', '1')
N = N.replace('x', '9')

print(int(N))

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

Solution (Python):


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

if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):


print(1110 - int(input()))

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

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

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

Solution (Python):
n = list(input())
a = {"1":"9","9":"1"}
print(a[n[0]]+a[n[1]]+a[n[2]])

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 >= 9:
    n -= 8
else:
    n += 8

if n % 100 >= 90:
    n -= 80
else:
    n += 80

if n >= 900:
    n -= 800
else:
    n += 800

print(n)

Solution (Python):
S = input()

for i in S:
    print(10 - int(i),end='')
print()

Solution (Python):

n = list(input())
a = []
for i in n:
	if i == '1':
		a.append(9)
	elif i == '9':
		a.append(1)
print(a[0] * 100 + a[1] * 10 + a[2])

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

Solution (Python):
inp = input()

corrected = ""
for l in inp:
  if l == "1":
    corrected += "9"
  elif l == "9":
    corrected += "1"
  else:
    print("error")

print(int(corrected))

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

Solution (Python):
s = input()

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

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

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

for i in n:
    if i == "1":
        n[count] = "9"
    elif i == "9":
        n[count] = "1"
    count += 1

print("".join(n))

Solution (Python):
n = list(input())
indexes = [i for i,j in enumerate(n) if j == '1']
res = ['0']*3
for i in range(len(n)):
    if i in indexes:
        res[i]='9'
    else:
        res[i]='1'
print(''.join(res))

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

print(1110-n)

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

def revers_n(i):
    
    if n[i] == "1":
        return 9
    elif n[i] == "9":
        return 1

print(100*revers_n(0)+10*revers_n(1)+revers_n(2))

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

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

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

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

Solution (Python):
n=input()

num = ""

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


print(num)

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

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

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

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

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

Solution (Python):
N = list(input())
ANS = list(map(lambda n: '9' if n == '1' else '1', N))
print(''.join(ANS))

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

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

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

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

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

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

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

new = ""
for i in range(len(n)):
    new += dict[n[i]]

print(new)

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

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

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

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

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LS()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007


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

def B():
    return


def C():
    return


def D():
    return


def E():
    return


def F():
    return


def G():
    return


def H():
    return


if __name__ == "__main__":
    A()

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

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

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

Solution (Python):


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

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

n = "".join(n)

print(n)

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

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

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

Solution (Python):
S = input()

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

print(ans)

Solution (Python):
N = input()

def main():
    ans = ''
    for n in N:
        if n == '1':
            ans += '9'
        elif n == '9':
            ans += '1'
        else:
            ans += n
    return ans

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

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

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

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

Solution (Python):

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

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

Solution (Python):

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

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

def reverse(N):
  Answer = ''
  for x in N:
    if x == '1':
      Answer += '9'
    else:
      Answer += '1'
  return Answer
print(reverse(N))

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

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

Solution (Python):
N = input()
res = ''
for idx, i in enumerate(N):
    res += '1' if i == '9' else '9' 
print(res)

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

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

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

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

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

Solution (Python):




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

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

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