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:
def main():
    n = list(input())
 
    if n[0] == '1':
        n[0] = '9'
    else:
        n[0] = '1'
 
    if n[1] == '1':
        n[1] = '9'
    else:
        n[1] = '1'
 
    if n[2] == '1':
        n[2] = '9'
    else:
        n[2] = '1'
 
    print(''.join(n))
 
main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    from sys import stdin
    r = stdin.readline()[:-1]
    #n = int(stdin.readline()[:-1])   
    #r = [stdin.readline() for i in range(n)]
    #t = [int(stdin.readline()) for i in range(n)]

    res = ""
    for i in r:
        if i == '1':
            res += '9'
        else:
            res += '1'
    print(res)
   
if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
s = input()
li = ['']*3
for i in range(len(s)):
    if s[i]=='1':
        li[i]='9'
    elif s[i]=='9':
        li[i]='1'
    else:
        li[i]=s[i]
print(''.join(li))

Submission status: Accepted

Solution code:
s = input()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 
print(r)

Submission status: Accepted

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

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

print("".join(n))

Submission status: Accepted

Solution code:
n = input()

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

print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
A=[]
for i in s:
  if i=='9':
    A.append('1')
  elif i=='1':
    A.append('9')
  else:
    A.append(str(i))

a=''.join(A)
print(a)

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:
n = input()

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

print(r)

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

Solution code:
def main():
    n = list(input())

    if n[0] == '1':
        n[0] = '9'
    else:
        n[0] = '1'

    if n[1] == '1':
        n[1] = '9'
    else:
        n[1] = '1'

    if n[2] == '1':
        n[2] = '9'
    else:
        n[2] = '1'

    print(''.join(n))

main()

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'

print(''.join(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
text = list(input())

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))

Submission status: Accepted

Solution code:
n=list(input())
a=[]
for x in n:
    if x=='1':
        a.append('9')
    elif x=='9':
        a.append('1')
    else:
        a.append(x)
print(''.join(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
z=input()
l = len(z)
char_list =list(z)
for i in range(int (l)):
  if char_list[i]=="1":
    char_list[i]="9"
  elif char_list[i]=="9":
    char_list[i]="1"
s = ""
for i in range(int (l)):
  s=s+char_list[i]
print(s)

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

print(s)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = int(input())

if n == 111:
    print(999)
elif n == 119:
    print(991)
elif n == 199:
    print(911)
elif n == 999:
    print(111)
elif n == 991:
    print(119)
elif n == 911:
    print(199)
elif n == 191:
    print(919)
else:
    print(191)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
ans = ""

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
na = input()
n = ['8'] * 3
for i in range(3) :
    n[i] = na[i]
for i in range(3) :
    if n[i] == '1' :
        n[i] = '9'
        continue
    elif n[i] == '9' :
        n[i] = '1'
N = 0
for i in range(3) :
    k = int(n[i])
    N += k * 10 ** (2-i)
print(N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import os
import sys

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

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353

n = sys.stdin.buffer.readline().decode().rstrip()
for a in n:
    if a == '9':
        print(1, end='')

    if a == '1':
        print(9, end='')
print()

Submission status: Accepted

Solution code:
# coding: utf-8

num = input().rstrip()

num = num.replace("9", "2")
num = num.replace("1", "9")
num = num.replace("2", "1")
print(num)

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'
print(int(''.join(n)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

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

Submission status: Accepted

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

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

for i,s in enumerate(n):
  if s=="1":
    n[i]="9"
  elif s=="9":
  	n[i]="1"

print(*n,sep="")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=STR()
    a=[]
    for i in range(len(n)):
        #print(n[i])
        if n[i]=='1':
            a.append('9')
        else:
            a.append('1')
    print(*a,sep='')
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def switch(intput):
    s = str(intput)
    l = ""
    for x in s:
        if x == "9":
            l += "1"
            continue
        elif x == "1":
            l += "9"
    print(l)
    
switch(input())

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
S = list(input())

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

print(ans)

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:
s = list(str(input()))

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

    else:
        s[i] = '1'

print (''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

l = []

for x in n:
    if x == '1':
        x = '9'
        l.append(x)
    elif x == '9':
        x = '1'
        l.append(x)
    else:
        l.append(x)

print(''.join(l))

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 n:
    if i == '1':
        print(9,end='')
    else:
        print(1,end='')
print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
str = list(N)
for i in range(3):
  if str[i] == "9":
    str[i] = "1"
  elif str[i] == "1":
    str[i] = "9"
str2 = "".join(str)
print(str2)

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(n[i],end="")

print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a=input()

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

Submission status: Accepted

Solution code:
import sys
import numpy as np
input = sys.stdin.readline
n = list(input().rstrip())
for i in range(len(n)):
    if n[i] == "1":
        n[i] = "9"
    else:
        n[i] = "1"
print("".join(n))

Submission status: Accepted

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

print(s)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
reverse_str = ''
for s in n:
  if s == '1':
    reverse_str = reverse_str + '9'
  elif s == '9':
    reverse_str = reverse_str + '1'
  else:
    reverse_str = reverse_str + s

print(reverse_str)

Submission status: Accepted

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

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:
print("".join("1" if c == "9" else "9" for c in input()))

Submission status: Accepted

Solution code:
n = list(map(int, input()))
for i in range(3):
    if n[i] == 1:
        n[i] = 9
        continue
    if n[i] == 9:
        n[i] = 1
a = "".join(map(str, n))
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
res = ""
for i in n:
    tmp = 10 - int(i)
    res += str(tmp)
print(res)

Submission status: Accepted

Solution code:
N = str(input())
O=N.replace('1','5')
P=O.replace('9','1')
Q=P.replace('5','9')
print(Q)

Submission status: Accepted

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

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print(''.join(list('9'if x=='1'else'1'for x in input())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC111a
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

print(input()[:-1].replace('1', 'a').replace('9', '1').replace('a', '9'))

Submission status: Accepted

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

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,sep="")

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
##### 解けた #####

n=list(map(int,list(input())))
no=[] # 出力

for ni in n:
    no.append(str(10-ni))

print("".join(no))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = list(input())
    s = ''
    for val in n:
        if val == '1':
            s += '9'
        else:
            s += '1'
    print(s)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

#入力
n = int(input())

print (1110 - n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

for i, num in enumerate(n):
  if num == '1':
    num = '9'
  else:
    num = '1'
  n[i] = num

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

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

Submission status: Accepted

Solution code:
n=list(input())
ans=[]
for item in n:
  if item=="1":
    ans.append("9")
  elif item=="9":
    ans.append("1")
ans="".join(ans)
print(ans)

Submission status: Accepted

Solution code:
s = list(input())

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

Submission status: Accepted

Solution code:
S = list(input())
for s in S:
    if s == "1":
        print("9",end = "")
    else:
        print("1",end = "")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
N = list(n)
for i in range(3):
  if N[i]=='1':
    N[i]='9'
  elif N[i]=='9':
    N[i]='1'
print(N[0]+N[1]+N[2])

Submission status: Accepted

Solution code:
n = input()
N = list(n)
for i in range(3):
  if N[i]=='1':
    N[i]='9'
  elif N[i]=='9':
    N[i]='1'
print(N[0]+N[1]+N[2])

Submission status: Accepted

Solution code:
n = input()
ans = ''
for s in n:
    ans += str(10-int(s))

print(ans)

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect_left
import heapq

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = input()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

anser = 0

if n > 200:
    anser += 100
else:
    anser += 900

if n % 100 > 20:
    anser += 10
else:
    anser += 90
    
if n % 10 > 2:
    anser += 1
else:
    anser += 9

print(anser)

Submission status: Accepted

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

ans = 0
for i in range(3):
    if n[i] == '1':
        ans += 9 * (10 ** (2 - i))
    elif n[i] == '9':
        ans += 1 * (10 ** (2 - i))
    else:
        ans += int(n[i]) * (10 ** (2 - i))

print(ans)

Submission status: Accepted

Solution code:
s=input()
t=s.replace("9","2")
u=t.replace("1","3")
v=u.replace("2","1")
w=v.replace("3","9")

print(w)

Submission status: Accepted

Solution code:
n=input()
a=[]
for i in n:
    if i == "1":
        a.append("9")
    else:
        a.append("1")
print(a[0]+a[1]+a[2])

Submission status: Accepted

Solution code:
nl = list(input())

nn = []
for n in nl:
    if n == "1":
        nn.append("9")
    else:
        nn.append("1")
        
print("".join(nn))

Submission status: Accepted

Solution code:
n=input()
x=1
y=1
z=1

if n[0]=="1":
    x=9
if n[1]=="1":
    y=9
if n[2]=="1":
    z=9
print(x*100+y*10+z)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

print(111+999-n)

Submission status: Accepted

Solution code:
n = input()
dict = {"1" : "9", "9" : "1"}
ans = ""
for i in range(len(n)) :
    ans += dict[n[i]]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
s = s.replace("9", "#")
s = s.replace("1", "9")
s = s.replace("#", "1")
print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

ret = ["1" if ni=="9" else "9"  for ni in n]
ret = "".join(ret)
ret = int(ret)

  
print(ret)

Submission status: Accepted

Solution code:
# 2019-11-10 17:11:42(JST)
import sys
# import collections
# import math
# from string import ascii_lowercase, ascii_uppercase, digits
# from bisect import bisect_left as bi_l, bisect_right as bi_r
# import itertools
# from functools import reduce
# import operator as op
# from scipy.misc import comb # float
# import numpy as np 

def main():
    n = list(sys.stdin.readline().rstrip())
    for i in range(len(n)):
        if n[i] == '9':
            n[i] = '1'
        else:
            n[i] ='9'

    
    print(''.join(n))

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()
ns = ""
for i in s:
    if i =="1":
        ns += "9"
    else:
        ns += "1"

print(ns)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

main()

Submission status: Accepted

Solution code:
S = list(map(str, input()))

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 111: A – AtCoder Beginner Contest 999
n = input()
print(str(10 - int(n[0])) + str(10 - int(n[1])) + str(10 - int(n[2])))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = str(input())
ans = []
for i in range(len(N)):
    if N[i] == '1':
        ans.append('9')
    elif N[i] == '9':
        ans.append('1')
    else :
        ans.append(N[i])
print("".join(ans))

Submission status: Accepted

Solution code:
x = int(input())

s = str(x)

#一文字ずつの簡単な置き換え
s1 = s.translate(str.maketrans({'1': '9', '9': '1'}))
	
print(int(s1))

Submission status: Accepted

Solution code:
N = str(input())
A = []


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

print(''.join(A))

Submission status: Accepted

Solution code:
n = input()
t = [0]*3
t[0] = str(10 - int(n[0]))
t[1] = str(10 - int(n[1]))
t[2] = str(10 - int(n[2]))
print(str(t[0]+str(t[1])+str(t[2])))

Submission status: Accepted

Solution code:
S = input()
conv = {'1': '9', '9': '1'}
for s in S:
    print(conv[s], end='')
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=list(input())
ans=[]
for i in s:
  if i =='1':
    ans +=['9']
  if i =='9':
    ans +=['1']
ans=''.join(ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
time = 100
ans = 0
for i in range(len(n)):
	if n[i] == '1':
		ans += 9 * time
	elif n[i] == '9':
		ans += 1 * time 
	else:
		ans += int(n[i])*time
	time /= 10

print(int(ans))

Submission status: Accepted

Solution code:
n = input()

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

print(new_n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(n.translate(table))

Submission status: Accepted

Solution code:
n = int(input())
if n//100 == 1:
  n += 800
else:
  n -= 800
if (n//10)%10 == 1:
  n += 80
else:
  n -= 80
if n%10 == 1:
  n += 8
else:
  n -= 8
print(n)

Submission status: Accepted

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

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

ans = ''.join(n_list)        
print(ans)

Submission status: Accepted

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