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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = input().strip()

print(''.join(['1' if c == '9' else '9' for c in N]))

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:
# -*- coding: utf-8 -*-

#入力
n = int(input())

#処理
if n%10 == 1:
    a = 9
else:
    a = 1

n = n//10

if n%10 == 1:
    b = 9
else:
    b = 1

n = n//10

if n == 1:
    c = 9
else:
    c = 1

ans = 100*c + 10*b + a

print(ans)

Submission status: Accepted

Solution code:

n = int(input())
s = str(n)

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

print()

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 s in n:
    if s == '1':
        res += '9'
    else:
        res += '1'
print(res)

Submission status: Accepted

Solution code:
n = str(input())

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

print(1110-n)

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

Solution code:
n = list(input())
d100 = int(n[0])
d10 = int(n[1])
d1 = int(n[2])

if d100 == 1:
    d100 = 9
elif d100 == 9:
    d100 =1

if d10 == 1:
    d10 = 9
elif d10 == 9:
    d10 = 1

if d1 == 1:
    d1 = 9
elif d1 == 9:
    d1 = 1

n = d100*100 + d10*10 + d1
print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
for c in S: print(chr(ord(c) ^ ord('1') ^ ord('9')), 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"
print("".join(n))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = input()

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
n = input()

ans = []

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

print(''.join(ans))

Submission status: Accepted

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

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

print(''.join(s))

Submission status: Accepted

Solution code:
# | Its_Rashid | #
a = input()
print(a .replace('9' , 'r').replace('1' , '9').replace('r' , '1'))
#a = a .replace('9' , 'r').replace('1' , '9').replace('r' , '1')
#print(a)

Submission status: Accepted

Solution code:
# | Its_Rashid | #
a = input()
a = a .replace('9' , 'r')
a = a .replace('1' , '9')
a = a .replace('r' , '1')
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
d = {'1':'9','9':'1'}
s = input()
print(d[s[0]]+d[s[1]]+d[s[2]])

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

Submission status: Accepted

Solution code:
n = input()

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

print(ans)

Submission status: Accepted

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


if __name__ == "__main__":
    main()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())
nl =[]

for i in n:
    if i == '1':
        nl.append('9')
    else:
        nl.append('1')
print(''.join(nl))

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

Solution code:
# A - AtCoder Beginner Contest 999
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:
n=str(input())
ans=n.translate(str.maketrans({'1':'9','9':'1'}))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = input()
N = N.translate(str.maketrans({"1":"9", "9":"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[0]*100+N[1]*10+N[2])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    solve()

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:
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n = input()
    conv = {'1': '9', '9': '1'}
    print(conv[n[0]] + conv[n[1]] + conv[n[2]])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

table = str.maketrans({
    '1': '9',
    '9': '1',
})

print(n.translate(table))

Submission status: Accepted

Solution code:
n = input()

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

print(n)

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

Submission status: Accepted

Solution code:
s = str(input())

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

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

Submission status: Accepted

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

n = int(input().strip())

ans=""
for s in str(n):
  if s == "1":
    ans += "9"
  elif s == "9":
    ans += "1"
  else:
    ans += s

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

print(n.translate(str.maketrans('19','91')))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
print(1110-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:
n = input()
for i in n:
    if i == "1":
        print("9", end="")
    elif i == "9":
        print("1", end="")

Submission status: Accepted

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

Submission status: Accepted

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

print(answer)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
arg = input()

res = ''
for c in arg:
    if c == '1':
        res += '9'
    elif c == '9':
        res += '1'
    else:
        res += c

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if n[0] == "1":
    ans += "9"
elif n[0] == "9":
    ans += "1"

if n[1] == "1":
    ans += "9"
elif n[1] == "9":
    ans += "1"

if n[2] == "1":
    ans+="9"
elif n[2] == "9":
    ans += "1"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

if (n[0] == '1'):
	n = '9' + n[1] + n[2]
elif (n[0] == '9'):
	n = '1' + n[1] + n[2]

if (n[1] == '1'):
	n = n[0] + '9' + n[2]
elif (n[1] == '9'):
	n = n[0] + '1' + n[2]

if (n[2] == '1'):
	n = n[0] + n[1] + '9'
elif (n[2] == '9'):
	n = n[0] + n[1] + '1'

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

for i in range(len(n)):
    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 = ([int(i) for i in input()])

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

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:
s=str(input())
S=list(s)
t=''
for i in range(3):
  if S[i]=='1':
    t+='9'
  else:
    t+='1'
print(t)

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

Submission status: Accepted

Solution code:
n = list(input())

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

print(*ans, sep="")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
print(str(10 - int(S[0])) + str(10 - int(S[1])) + str(10 - int(S[2])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x=input()
print 1110-x

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = list(input())
for i in range(len(n)):
    n[i] = 10 - int(n[i])
print(*n, sep='')

Submission status: Accepted

Solution code:
n = list(input())

ans = ""

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
s = ""
if n[0] == "1":
	s += "9"
else:
	s += "1"

if n[1] == "1":
	s += "9"
else:
	s += "1"

if n[2] == "1":
	s += "9"
else:
	s += "1"

print (s)

Submission status: Accepted

Solution code:
N=list(input())
for i in range(len(N)):
    N[i]=str(10-int(N[i]))
    
print("".join(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
S = input()
print(''.join([str(10 - int(S[i])) for i in range(len(S))]))

Submission status: Accepted

Solution code:
s = list(str(input()))
for i in range(len(s)):
    if s[i] == '9':
        s[i] = '1'
    elif s[i] == '1':
        s[i] = '9'

print(''.join(s))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
s=list(input())
r=[]
for x in s:
    if x=="1":r.append("9")
    elif x=="9":r.append("1")
    else:r.append(x)
print("".join(r))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    N = list(input())
    for n in N:
        if n == '9':
            print('1', end='')
        elif n == '1':
            print('9', end='')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = list(input())

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

print(''.join(n))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

IN=lambda : map(int, input().split())
mod=1000000007

#+++++

def main():
	a = input()
	r = ['1' if c == '9' else '9' for c in a]
	ret=''.join(r)
	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
d={
  "1":"9",
  "9":"1"
}

t=""
for i in n:
  if i == "1" or i == "9":
    t+=d[i]
  else:
    t+=i
print(t)

Submission status: Accepted

Solution code:
N = list(input())
A = {'1': '9', '9': '1'}

ans = ''
for i in N:
    ans += str(A[i])

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

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:
n = str(input())
nn = ''
for c in n:
    if c == '1':
        nn += '9'
    elif c == '9':
        nn += '1'
    else:
        nn += c
print(nn)

Submission status: Accepted

Solution code:
N=int(input())

print(1110-N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

new_n = ''
for l in n:
    if l == '1':
        new_n += '9'
    else :
        new_n += '1'

print(new_n)

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:
n=str(input())
X=""
for i in range(3):
    if n[i]=="1":
        X+="9"
    elif n[i]=="9":
        X+="1"
    else:
        X+=n[i]
print(X)

Submission status: Accepted

Solution code:
n = [i for i in 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 = list(input())
ans = []

for i in n:
    if i == '1':
        ans.append(9)
    elif i == '9':
        ans.append(1)

print(*ans, sep='')

Submission status: Accepted

Solution code:
import sys
import math
import itertools

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

Submission status: Accepted

Solution code:
S = input()

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

Submission status: Accepted

Solution code:
S=input()
S = S.replace("1", "Z")
S = S.replace("9", "1")
S = S.replace("Z", "9")
print(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 = int(input())
ans = ""
for i in range(3):
    a = str(n)[i]
    if a == "1":
        ans += "9"
    else:
        ans += "1"
print(ans)

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 22, Jan, 2020
"""

import sys

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N = int(readline())
print(1110-N)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=input()
    print(N.replace('1','X').replace('9','1').replace('X','9'))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()
l = []
for c in n:
    if c == "1":
        l.append("9")
    if c == "9":
        l.append("1")
ans = int("".join(l))
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(input())
for i in n:
  if i == "1":
    print(9,end="")
  else:
    print(1,end="")

Submission status: Accepted

Solution code:
# n=int(input())
# c=[int(input()) for i in range(n)]
s=input()
print(s.translate(str.maketrans({'9': '1', '1': '9'})))

Submission status: Accepted

Solution code:
import sys

INPUT = lambda: sys.stdin.readline().rstrip()

sys.setrecursionlimit(10 ** 9)


def main():
    n = INPUT()

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=input()
if n[0]=="1":
  s="9"
elif n[0]=="9":
  s="1"
else:
  s=n[0]
if n[1]=="1":
  s+="9"
elif n[1]=="9":
  s+="1"
else:
  s+=n[1]
if n[2]=="1":
  s+="9"
elif n[2]=="9":
  s+="1"
else:
  s+=n[2]
print(s)

Submission status: Accepted

Solution code:
import math
import queue
import bisect
import heapq
import time
import itertools

mod = int(1e9+7)

def swap(a,b):
    return (b,a)

def my_round(a,dig=0):
    p = 10 ** dig
    return (a * p * 2 + 1) // 2 / p

def gcd(a,b): #最大公約数
    if (a<b):
        a,b = swap(a,b)
    if (b==0):
        return a
    else:
        return gcd(b,a%b)

def lcm(a,b): #最小公倍数
    return a/gcd(a,b)*b

def divisors(a): # 約数列挙
    divisors = []
    for i in range(1,int(a**0.5)+1):
        if a%i==0:
            divisors.append(i)
            if i!=a//i:
                divisors.append(a//i)
    return divisors

def is_prime(a): #素数判定
    if a<2:
        return False
    elif a==2:
        return True
    elif a%2==0:
        return False
    sqrt_num = int(a**0.5)
    for i in range(3,sqrt_num+1,2):
        if a%i==0:
            return False
    return True

def prime_num(a): #素数列挙
    pn = [2]
    for i in range(3,int(a**0.5),2):
        prime = True
        for j in pn:
            if i%j==0:
                prime = False
                break
        if prime:
            pn.append(i)
    return pn

def prime_fact(a): #素因数分解
    sqrt = math.sqrt(a)
    res = []
    i = 2
    if is_prime(a):
        res.append(a)
    else:
        while a!=1:
            while a%i==0:
                res.append(i)
                a //= i
            i += 1
    return res

def main():
    n = input()
    ans = []
    for i in range(3):
        if n[i] == '1':
            ans.append('9')
        else:
            ans.append('1')
    print(''.join(ans))
    return

if __name__=='__main__':
    main()