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



Sample input:
119


Sample output:
991

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC111A - AtCoder Beginner Contest 999
print(input().translate(str.maketrans({"1": "9", "9": "1"})))

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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))  # type: int
    solve(n)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys


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

    return


# Generated by 1.1.3 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    n = str(next(tokens))  # type: int
    solve(n)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

print(1110 - int(input()))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#111 A
N =input()
ans=""
for i in N:
    if i=="1":
        ans+="9"
    else:
        ans+="1"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()

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

print(int(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

print(1110 - int(input()))

Submission status: Accepted

Solution code:
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))]

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
#python 3.7.1
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])

Submission status: Accepted

Solution code:
inp = input()

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

print(int(corrected))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
l = list(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(new)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
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

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

#C
def C():
    return

#D
def D():
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    A()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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 = '')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
s = input()
print(s.translate(str.maketrans({'1': '9', '9': '1'})))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

Solution code:
N = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
T=int(input())
print(1110-T)

Submission status: Accepted

Solution code:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input();print(((int(s[0])%9)*8+1)*100+((int(s[1])%9)*8+1)*10+(int(s[2])%9)*8+1)

Submission status: Accepted

Solution code:
n = input()
n = n.replace("1","0")
n = n.replace("9","1")
n = n.replace("0","9")
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#999
l = []
inp = input()
for i in range(len(inp)):
    if inp[i] == "1":
        l.append("9")
    elif inp[i] == "9":
        l.append("1")
    else:
        l.append(inp[i])

for i in range(len(l)):
    print(l[i], end='')

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
str = list(input())

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

Submission status: Accepted

Solution code:
str = list(input())

ans = list()

for i in str:
    if i == "9":
        ans.append("1")
    else:
        ans.append("9")

for a in ans:
    print(a, end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join(['91'[b] for b in map(lambda a:a=='9',input())]))

Submission status: Accepted

Solution code:
s, = input().split()
t=""
for i in s:
    x = ""
    if i == '9':
        x = '1'
    elif i == '1':
        x = '9'
    else:
        x = i
    t += x
print(t)

Submission status: Accepted

Solution code:
n = input()
print(n.replace("1","0").replace("9","1").replace("0","9"))

Submission status: Accepted

Solution code:
N=input()
answer=""
if N[0]=="1":
  answer+="9"
else:
  answer+="1"
if N[1]=="1":
  answer+="9"
else:
  answer+="1"
if N[2]=="1":
  answer+="9"
else:
  answer+="1"
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=str(input())
ans=""
for i in range(len(n)):
    a=n[i]
    if(n[i]=="9"):
        a="1"
    elif(n[i]=="1"):
        a="9"
    ans+=a
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())
for i in range(len(N)):
    if N[i] == '1':
        N[i]='9'
    elif N[i] == '9':
        N[i]='1'
answer = 100*int(N[0])+10*int(N[1])+int(N[2])
print(answer)

Submission status: Accepted

Solution code:
n = input()
N = list(n)

for i in range(len(N)):
  if N[i] == str(1):
    N[i] = str(9)
  elif N[i] == str(9):
    N[i] = str(1)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
N=int(input())
A=N//100
B=(N-A*100)//10
C=N-A*100-B*10
if A==1:
    A=9
elif A==9:
    A=1
if B==1:
    B=9
elif B==9:
    B=1
if C==1:
    C=9
elif C==9:
    C=1
ans=A*100+B*10+C
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
number = int(input())
answer = 0

for i in range(3):
    divider = 10 ** (2-i)
    target_org = int(number / divider)
    target = 0

    if target_org == 1:
        target = 9
    elif target_org == 9:
        target = 1
    else:
        target = target_org

    answer += target * 10 ** (2-i)

    number -= target_org * 10 ** (2-i)



print(answer)

Submission status: Accepted

Solution code:
num = input()
for i in list(num):
  if(i == "1"):
    print(9, end="")
  elif(i == "9"):
    print(1, end="")
  else:
    print(i, end="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())
one_idx = []
nine_idx = []
for idx in range(len(n)):
	if n[idx]=='1':
		one_idx.append(idx)
	if n[idx]=='9':
		nine_idx.append(idx)

out = ''
for idx in range(len(n)):
	if idx in one_idx:
		out += '9'
	if idx in nine_idx:
		out += '1'
          
print(out)

Submission status: Accepted

Solution code:
n = list(input())

result = ""

for a in n:
  if a == '1':
    result += '9'
  else:
    result += '1'


print(result)

Submission status: Accepted

Solution code:
A = input()
for a in A:
  if a is "1":
    print("9", end="")
  else:
    print("1", end="")
print("")

Submission status: Accepted

Solution code:
list1 = list(input())
list2 = []
for item in list1:
    if(item == "1"):
        item_mod = item.replace("1","9")
    else:
        item_mod = item.replace("9","1")
    list2.append(item_mod)
for i in list2:
    print(i,end="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=str(input())
sum=0
for i in n:
    if i=="1":
        sum=sum*10+9
    else:
        sum=sum*10+1
print(str(sum))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
t = input()
print(t.replace("1", "2").replace("9", "1").replace("2", "9"))

Submission status: Accepted

Solution code:
def ans():
  S=input()
  res=""
  for s in S:
    if(s=="1"):
      res+="9"
    else:
      res+="1"
  print(res)
ans()

Submission status: Accepted

Solution code:
def ans():
  S = input()
  res = ""
  for s in S:
    if(s == "1"):
      res += "9"
    else:
      res += "1"
  print(res)
ans()

Submission status: Accepted

Solution code:
n_list = list(input())
answer = ''
for i in n_list:
    if i == '1':
        answer += '9'
    else:
        answer += '1'
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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