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()
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(3):
    if n[i] == '1':
        n[i] = '9'
    else:
        n[i] = '1'
print(int(n[0]+n[1]+n[2]))

Submission status: Accepted

Solution code:
n = input()

s = ""

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

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

Submission status: Accepted

Solution code:
n=input()

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

print(n)

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 = input()
s = n.translate(str.maketrans({'9': '1', '1': '9'}))
print(s)

Submission status: Accepted

Solution code:
num=str(input())
ans=""
for i in num:
   
    if i=="1":
        ans+="9"
    elif i=="9":
        ans+="1"

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

print(str(n).replace('1', 'W').replace('9', '1').replace('W', '9'))

Submission status: Accepted

Solution code:
n=input()

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

print(int(n))

Submission status: Accepted

Solution code:
a=input()
b=[int(x) for x in iter(a)]
for i in range(3):
    if b[i]==9:
        b[i]=1
    elif b[i]==1:
        b[i]=9
for x in b:
    print(x,end="")

Submission status: Accepted

Solution code:
n = input()

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# coding: utf-8

n = input().strip()
n = n.replace("9", "t")
n = n.replace("1", "9")
n = n.replace("t", "1")
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    s = list(input())

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

    print("".join(s))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

n = int(input())

n_100 = n // 100
n_10 = (n - n_100 * 100) // 10
n_1 = (n - n_100 * 100 - n_10 * 10)

if(n_100 == 9):
    n100 = 1
else:
    n100 = 9
if(n_10 == 9):
    n10 = 1
else:
    n10 = 9
if(n_1 == 9):
    n1 = 1
else:
    n1 = 9

print(n100*100 + n10*10 + n1)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = input()
if n[0] == '9':
    hyaku = 1
else:
    hyaku = 9
if n[1] == '9':
    ten = 1
else:
    ten = 9
if n[2] == '9':
    one = 1
else:
    one = 9
print(hyaku*100+ten*10+one)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n = list(map(int, input().split()))
n = input()
a = ""
for i in n:
    if i == "1":a += "9"
    elif i == "9":a += "1"
print(int(a))

Submission status: Accepted

Solution code:
l = list(input())

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

ans = l[0] + l[1] + l[2]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

r = []

for i in N:
    if i == '1':
        r.append('9')
    else:
        r.append('1')

print(''.join(r))

Submission status: Accepted

Solution code:
s = str(input())
list_s = list(s)

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

Submission status: Accepted

Solution code:
str1 = raw_input().replace("\n", "")
str2 = str1.replace("1", "A").replace("9", "B")
str3 = str2.replace("A", "9").replace("B", "1")
print str3

Submission status: Accepted

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
from sys import stdin

s = stdin.readline().rstrip()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

if a==1:
    a=9
elif a==9:
    a=1
    
if b==1:
    b=9
elif b==9:
    b=1
    
if c==1:
    c=9
elif c==9:
    c=1
    
print(a*100+b*10+c)

Submission status: Accepted

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

print(answer)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0

if n // 100 == 1:
    n -= 100
    ans += 100*9
else:
    n -= 900
    ans+= 100
if n // 10 == 1:
    n -= 10
    ans += 10*9
else:
    n -= 90
    ans += 10
if n // 1 == 1:
    ans += 9
else:
    ans += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
s = raw_input()

num = int(s)

ans = 1110-num

print ans

Submission status: Accepted

Solution code:
# encoding: utf-8
n = int(input())

n_tmp = n
ans = 0
for i in range(3):
    if n_tmp % 10 == 1: ans += 9 * (10 ** i)
    elif n_tmp % 10 == 9: ans += 1 * (10 ** i)
    else: ans += (n_tmp % 10) * (10 ** i)
    if i > 2: break
    n_tmp = n_tmp // 10

print(ans)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

print(s)

Submission status: Accepted

Solution code:
#!/Library/Frameworks/Python.framework/Versions/3.5/bin/python3

n = input()

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

Submission status: Accepted

Solution code:
s=raw_input()
ans=""
for x in s:
	if x=="1": ans+="9"
	elif x=="9": ans+="1"
print ans

Submission status: Accepted

Solution code:
def swap(char_str):
    ans = ''
    for i in char_str:
        if i == '9':
            ans += '1'
        if i == '1':
            ans += '9'
    return ans

n = input()
print(swap(n))

Submission status: Accepted

Solution code:
n_list = list(input())

ans = []

for n in n_list:
    if n == "9":
        ans.append("1")
    elif n == "1":
        ans.append("9")
    else:
        ans.append(n)

ans = int("".join(ans))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
def solve():
    n = input()
    n = n.replace('1', '.')
    n = n.replace('9', '1')
    n = n.replace('.', '9')
    res = n
    return str(res)

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
question="A"
input=raw_input
if question=="A":
	t=input()
	t=t.replace("9","n")
	t=t.replace("1","o")
	t=t.replace("n","1")
	t=t.replace("o","9")
	print(t)
if question=="B":
	pass
if question=="C":
	pass
if question=="D":
	pass
if question=="E":
	pass

Submission status: Accepted

Solution code:
n = raw_input()

n = n.replace('1', 'l')
n = n.replace('9', 'q')
n = n.replace('l', '9')
n = n.replace('q', '1')

print n

Submission status: Accepted

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

Submission status: Accepted

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

print("".join(a))

Submission status: Accepted

Solution code:
import numpy as np

a = input()
b = ''
for aa in a:
    if aa == '1':
        b += '9'
    else:
        b += '1'
print(b)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
if __name__ == '__main__' :
    A = input()
    B = ""
    for i in range(0,len(A)):
        if A[i] == '1':
            B += '9'
        elif A[i] == '9':
            B += '1'
        else:
            B += A[i]
    print(B)

Submission status: Accepted

Solution code:
num = input()

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

Submission status: Accepted

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

print(n)

Submission status: Accepted

Solution code:
intput_ = list(input())
output = ""
for s_ in intput_:
  if s_ == '1':
    output += "9"
  elif s_ == '9':
    output += "1"
  else:
    output += s_

print(output)

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:
if __name__ == '__main__':
    N = input()
    result = ''
    for n in N:
        if n == '1':
            result += '9'
        elif n == '9':
            result += '1'
    print(int(result))

Submission status: Accepted

Solution code:
import numpy as np
import math

# K = int(input())
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
# S = input() # String
# DP = np.zeros((N, Y), dtype=int)

N = list(map(int, 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], sep='')

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:
n = input().strip()
print(n.translate(str.maketrans({"1":"9", "9":"1"})))

Submission status: Accepted

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

Submission status: Accepted

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

index=0
while index < 3:
    if listN[index] == "1":
        listN[index]="9"
    elif listN[index]=="9":
        listN[index]="1"
    index+=1

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

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

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = list(input())

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

print("".join(n))

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=input()
m=n.replace('1','6')
l=m.replace('9','1')
o=l.replace('6','9')
print(o)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

ans = ""
for s in n:
    ans += ["1", "9"][s == "1"]

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n = input()
    n = n.replace('1', 't')
    n = n.replace('9', '1')
    n = n.replace('t', '9')
    print(n)

Submission status: Accepted

Solution code:
n = input()
out = ''

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

print (out)

Submission status: Accepted

Solution code:
s = input()

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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:
c = input()
temp = []
for i in range(len(c)):
    if c[i] =="1":
        temp.append("9")
    else:
        temp.append("1")
print("".join(temp))

Submission status: Accepted

Solution code:
N = input()
res = ''
for i in range(len(N)):
    if N[i] == '1':
        res += '9'
    if N[i] == '9':
        res += '1'
        
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:
# cook your dish here
s=list(input())
ass =''
for i in range(len(s)):
    if s[i] == '9':
        s[i] = '1'
    else:
        s[i] = '9'
    ass += s[i]
print(ass)

Submission status: Accepted

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

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

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()
a = ''
for x in n:
	if x == '1':
		a += '9'
	elif x == '9':
		a += '1'
	else:
		a += x
print(a)

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

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


print()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())

l = ""
for num in N:
    if num == "1":
        l = l + "9"
    else:
        l = l + "1"

print(l)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    n = input()
    ans = ""
    for nn in n:
        if nn == "9":
            ans += "1"
        elif nn == "1":
            ans += "9"
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = input()

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

print(answer)

Submission status: Accepted

Solution code:
# coding:utf-8

INF = float('inf')


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


N = int(input())
N = str(N)
ans = ''
for n in N:
    if n == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Submission status: Accepted

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

print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = 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:
S = input()
T = ""
for k in S:
    if k == "1":
        T += "9"
    else:
        T += "1"
print(T)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

ans = ''
for dig in n:
    if dig == '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':
        print('9',end='')
    if n[i]=='9':
        print('1',end='')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = list(input())
ans = [''] * len(N)
for k in range(len(N)):
    if N[k] == '1':
        ans[k] = '9'
    if N[k] == '9':
        ans[k] = '1'
print(''.join(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input()
f = ''
for x in a:
    if x == '1':
        f = f + '9'
    else:
        f = f + '1'

print(f)

Submission status: Accepted

Solution code:
n = str(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect
import numpy as np

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

Submission status: Accepted

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

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

for s in S:
    if s == '1':
        s = 9
    elif s == '9':
        s = 1

    print(s, end='')

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

Submission status: Accepted

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

Submission status: Accepted

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

EXTRA = "a"

print(input().replace("1", EXTRA).replace("9", "1").replace(EXTRA, "9"))

Submission status: Accepted

Solution code:
s = input()
ans = ""
for i in s:
    ans += str(10 - int(i))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

def inputN(typ=str):
    return map(typ, raw_input().split())

n = inputN(str)[0]
a = ''
for c in n:
    if c == '1':
        a += '9'
    elif c == '9':
        a += '1'
    else:
        a += c
print a

Submission status: Accepted

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

Submission status: Accepted

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

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve(N):
    return l.replace("1", "8").replace("9", "1").replace("8", "9")

if __name__ == "__main__":
    l = input()
    print(solve(l))

Submission status: Accepted

Solution code:

S = input()

ans = ""
for s in S:
    if s == "1":
        ans += "9"
    elif s == "9":
        ans += "1"

print(ans)

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:
a = list(input())
ans = ""
for c in a:
    if c == "1":
        ans = ans + "9"
    else:
        ans = ans + "1"
print(ans)

Submission status: Accepted

Solution code:
N = input()

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

Submission status: Accepted

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

def main():
    n = input()
    for i in n:
        if i == '1':
            print(9, end='')
        elif i == '9':
            print(1, end='')
    print('')
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = input()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
REPL = {"1": "9", "9": "1"}

num = input()
for char in num:
  print(REPL.get(char, char), end="")
print()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
alist  = list(map(int,input().split()))
list1 = alist[1::2]
list2 = alist[0::2]
from collections import Counter
dic1 = Counter(list1).most_common()
dic2 = Counter(list2).most_common()

if dic1[0][0]!=dic2[0][0]:
  print(n - dic1[0][1] - dic2[0][1]+1)
else:
  print(min(n - dic1[0][1] - dic2[1][1]+1, n -dic1[1][1] - dic2[0][1]+1))

Submission status: Runtime Error

Solution code:
def f(c):
  if c == "1":
    return "9"
  elif c == "9":
    return 1
  else:
    return c
  
print(''.join(list(map(f, input()))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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