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

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

print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=list(input())
m=[]
for i in range(0,3):
  if n[i]=='9':
    m.append('1')
  else:
    m.append('9')
ma=''.join(m)
print(ma)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=input()
print(str(10-int(a)) + str(10-int(b)) +str(10-int(c)))

Submission status: Accepted

Solution code:
n = {111: 999, 119:991, 911:199, 191:919, 199:911, 991:119, 919:191, 999:111}
print(n[int(input())])

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'
s=''
for i in range(3):
  s+=n[i]
print(s)

Submission status: Accepted

Solution code:
s = input()
dic = {"1": "9", "9": "1"}
for c in s:
  print(dic[c], end="")

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:
s = str(input())
table = s.maketrans('19','91')
print(s.translate(table))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = str(input())
ans = []
for i in range(3):
    if S[i]=="1":
        ans.append(9)
    elif S[i]=="9":
        ans.append(1)
        
print(''.join(map(str, ans)))

Submission status: Accepted

Solution code:
#111a
S = str(input())
ans = []
for i in range(3):
    if S[i]=="1":
        ans.append(9)
    elif S[i]=="9":
        ans.append(1)
        
print(''.join(map(str, ans)))

Submission status: Accepted

Solution code:
print(''.join([str(int(i) * 9 % 10) for i in input()]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

print(''.join(new))

Submission status: Accepted

Solution code:
s = input()
a = [c for c in s]

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

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()
S =[]
S.append(s)
ans = []
for i in range(len(s)):
    if S[0][i] == "1":
        ans.append("9")
    else:
        ans.append("1")
aim = "".join(ans)
print(aim)

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
print(''.join([i.replace('9','1') if i!='1' else '9' for i in input()]))

Submission status: Accepted

Solution code:
a = input()
n = ""
for i in a:
  if i == "1":
    n = n + "9"
  else:
    n = n + "1"
print(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'
    print(n[i], end='')
print()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s=input()
ss = ''
for c in s:
	if c == "1":
		ss += "9"
	else:
		ss += "1"
print(ss)

Submission status: Accepted

Solution code:
'''
A - AtCoder Beginner Contest 999
https://atcoder.jp/contests/abc111/tasks/abc111_a

>>> main(119)
991
>>> main(999)
111
'''


def main(n):
    res = ''
    for _n in str(n):
        if _n == '1':
            res += '9'
        else:
            res += '1'

    print(res)


if __name__ == '__main__':
    main(int(input()))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n=input()
l=['1','9']
for i in n:
    print(l[l.index(i)-1], end = '')
print()

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    s = str(input().rstrip('\n'))
    print(s.replace("1", "*").replace("9", "1").replace("*", "9"))


if __name__ == '__main__':
    slove()

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:
import sys

input = sys.stdin.readline


def main():
    rep = {"1": "9", "9": "1"}
    print("".join([rep.get(c, c) for c in input().strip()]))


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"
    if i == 0:
        s = str(n[i])
    else:
        s = s+ str(n[i])
print(int(s))

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
w = input()
c = ""
for i in w:
  if i == "9":
    i = "1"
    c += i
  elif i == "1":
    i = "9"
    c += i
print(c)

Submission status: Accepted

Solution code:
n = input()
s = []
ans = 0
for i in range(len(n)):
    if n[i] == '1':
        ans += 9*(10**(2-i))
    elif n[i] == '9':
        ans += 1*(10**(2-i))
print(ans)

Submission status: Accepted

Solution code:
print("".join([i.replace("9", "1") if i != "1" else "9" for i in input()]))

Submission status: Accepted

Solution code:
N=input()

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

Submission status: Accepted

Solution code:
n = [i for i in input()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#2019/09/26
n = input()
s = [(i.replace("1", "9") if i == "1" else i.replace("9", "1") if i == "9" else i) for i in n]
print(''.join(s))

Submission status: Accepted

Solution code:
print(str(1110-int(input())))

Submission status: Accepted

Solution code:
L=[[111,119,191,199,911,919,991,999],\
   [999,991,919,911,199,191,119,111]]
print(L[1][L[0].index(int(input()))])

Submission status: Accepted

Solution code:
n = list(str(input()))
a = list(range(0, 10))
a[1] = 9; a[9] = 1
b = [str(a[int(i)]) for i in n]
print("".join(b))

Submission status: Accepted

Solution code:
s = input()
ans = ''
for i in range(3):
    if s[i] == '1':
        ans += '9'
    else:
        ans += '1'
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"
a=s[0]+s[1]+s[2]
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
ans = []

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

print("".join(ans))

Submission status: Accepted

Solution code:
n = [int(_) for _ in input()]

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

Submission status: Accepted

Solution code:
n = input()
print(n.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'

print(''.join(n))

Submission status: Accepted

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

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())
result = ""

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

print(result)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

a = n % 10
b = ((n-a) //10) % 10
c = (n-b-a) //100

d = 0
e = 0
f = 0

if a == 1:
  d = 9
else:
  d=1
if b == 1:
  e = 9
else:
  e=1
if c == 1:
  f = 9
else:
  f=1
  
print(d + e*10 + f*100)

Submission status: Accepted

Solution code:
n = input()
ans = []
for ni in n:
    if ni == '1':
        ans.append('9')
    elif ni == '9':
        ans.append('1')
    else:
        ans.append(ni)
print(ans[0]+ans[1]+ans[2])

Submission status: Accepted

Solution code:
n = input().strip()
x = ""
for i in range(len(n)):
    if n[i]=="1":
        x += "9"
    elif n[i]=="9":
        x += "1"
print(x)

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = str(input())
output = ""

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

    elif n[i] == "9":
        output = output + "1"

print(int(output))

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    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:
S = list(input())
for i in range(3):
  if S[i]=="9":
    S[i]="1"
  elif S[i]=="1":
    S[i] ="9"
print("".join(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:
s = input()
print(s.replace('1','2').replace('9','1').replace('2','9'))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = str(input())

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

print(ans)

Submission status: Accepted

Solution code:
print(''.join(list(map(str, map(lambda x: int(9/int(x)) if int(9%int(x))==0 else x, input())))))

Submission status: Accepted

Solution code:
s=input()
t=[]
for i in range(3):
  if s[i] =='9':
    t.append('1')
  else:
    t.append('9')
st="".join(t)
print(st)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC111A
def f(s):
    if s == '1':
        return '9'
    else:
        return '1'
    
n = input()
print(f(n[0])+f(n[1])+f(n[2]))

Submission status: Accepted

Solution code:
S = int(input()) 
inp = [111,119,191,911,199,919,991,999]
out = [999,991,919,199,911,191,119,111]

for i in range(8):
  if inp[i] == S:
    print(out[i])
    quit()

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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(s[0]*100+s[1]*10+s[2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a = list(input())
if a[0]=="1":
        i="9"
else:
        i="1"
if a[1]=="1":
        j="9"
else:
        j="1"        
if a[2]=="1":
        k="9"
else:
        k="1"
print(i+j+k)

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:
#coding:utf-8
n = input()
m = []

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

print(''.join(m))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
output1 = [0,0,0]

for x in range (3):

    output1[x]=n[x]
    
    if n[x]=='1':
        output1[x]=9
    if n[x]=='9':
        output1[x]=1
str1 = ''.join(str(e) for e in output1)

print (str1)

Submission status: Accepted

Solution code:
n = input()

s_list = []

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

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

Submission status: Accepted

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

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
  else:
    n[i] = int(n[i])

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

Submission status: Accepted

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

n=''.join(n)

print(n)

Submission status: Accepted

Solution code:
N = str(input())

ans = ""
for n in N:
    formura = "10-{}".format(n)
    ans += str(eval(formura))

print(int(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
n = input()

print(int(("1" if n[0] == "9" else "9") + ("1" if n[1] == "9" else "9") + ("1" if n[2] == "9" else "9")))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

N = input().split()
N = N[0]
ans=""
for i in range(3):
    if N[i]=="1":
        ans+="9"
    else:
        ans+="1"
print(ans)

Submission status: Accepted

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

print(''.join(ans))

Submission status: Accepted

Solution code:
n = input()
l = ["0"]*3
l[0] = "9" if n[0] == "1" else "1"
l[1] = "9" if n[1] == "1" else "1"
l[2] = "9" if n[2] == "1" else "1"
r = "".join(l)
print(r)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

n = input().strip()
ans = ''
for digit in n:
    if digit == '1':
        ans += '9'
    elif digit == '9':
        ans += '1'
    else:
        ans += digit
    
print(ans)

Submission status: Accepted

Solution code:
n = input()
L = []
for i in n:
    L.append(i)
for i, v in enumerate(L):
    if v == '1':
        L[i] = '9'
    else:
        L[i] = '1'
print(''.join(L))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(int(x) for x in input())
ans = []
for i in range(3):
  if n[i] == 9:
    ans.append(1)
  else:
    ans.append(9)
print(ans[0] * 100 + ans[1] * 10 + ans[2])

Submission status: Accepted

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

	elif l[i]=="9":
		l[i]="1"

print("".join(l))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

a = ""
for i in range(len(s)):
  if s[i] == str(1):
    a += str(9)
  elif s[i] == str(9):
    a += str(1)
print(a)

Submission status: Accepted

Solution code:
# -*-coding: utf-8 -*-
n = str(input())

n = n.replace('1', '8')
n = n.replace('9', '2')
n = n.replace('8', '9')
n = n.replace('2', '1')
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=list(input())
for x in range(len(N)):
  if N[x]=="1":
    N[x]="9"
  else:
    N[x]="1"
print("".join(N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
l = list(str(input()))
for i in range(3):
    if l[i]=='1':
        l[i]='9'
    else:
        l[i]='1'
print(int(''.join(l)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
print(''.join([str(10 - int(x)) for x in input()]))

Submission status: Accepted

Solution code:
print(''.join(map(lambda x: str(10 - int(x)), input())))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()

ans = ""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = input()
    ans = ""
    for c in n:
        if c == "1":
            ans += "9"
        elif c == "9":
            ans += "1"
        else:
            ans += c
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#ABC111A
n = input()
a = n[:1]
b = n[1:2]
c = n[2:3]
if a == "1":
    a = "9"
else:
    a = "1"
if b == "1":
    b = "9"
else:
    b = "1"
if c == "1":
    c = "9"
else:
    c = "1"
print(a+b+c)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

Submission status: Accepted

Solution code:
S = input()

ans = ""

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = str(input())
lis = list(n)

ans = []
for i in range(len(lis)):
    if lis[i] == "1":
        ans.append("9")
    elif lis[i] == "9":
        ans.append("1")
print(int("".join(ans)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
n=n.translate(str.maketrans("19","91"))
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=n//100
b=n//10-10*a
c=n%10
if a==1:
    a=9
else:
    a=1
if b==1:
    b=9
else:
    b=1
if c==1:
    c=9
else:
    c=1
print(100*a+10*b+c)

Submission status: Accepted

Solution code:
print(int(input().replace("1","nine").replace("9","1").replace("nine","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"
print("".join(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

ans = ''
d = {'1': '9', '9': '1'}
for i in range(len(s)):
    ans += d[s[i]]

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
if n == 111 or 119 or 191 or 199 or 911 or 919 or 991 or 999:
    moji = str(n)
    li = list(moji)
    for i in range(len(li)):
        if li[i] == '1':
            li[i] = '9'
        else:
            li[i] = '1'
    moji = "".join(li)
    n = int(moji)
    print(n)
else:
    print('hoge!')

Submission status: Accepted

Solution code:
s1 = input()

r1 = ""

for i1 in range(len(s1)):
    if s1[i1] == "1":
        r1 = r1 + "9"
    else:
        r1 = r1 + "1"

print(r1)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#a = sorted(list(map(int, input().split())))
n = str(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
print("".join(["1" if s=="9" else "9" for s in str(input())]))

Submission status: Accepted

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

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

    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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:
a=input()
b=[a[0],a[1],a[2]]
for i in range(3):
  if b[i]=="1":
    b[i]="9"   
  elif b[i]=="9":
    b[i]="1" 
print(*b,sep="")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    s = input()
    ans = ""
    for c in s:
        if c == "1":
            ans += "9"
        else:
            ans += "1"
    return int(ans)

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

Submission status: Accepted

Solution code:
print(input().translate(str.maketrans('19','91')))

Submission status: Accepted

Solution code:
s='19'
n=input()
for i in n:
    print(s[i=='1'],end='')
print()

Submission status: Accepted

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