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

Solution (Python):
n = list(input())

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

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

Solution (Python):
num=input()
num_list=list(num)

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




num_changed="".join(num_list)

print(int(num_changed))

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

Solution (Python):
def main():
    n = input()
    ans = ""

    for c in n:
        if c == '1':
            ans += '9'
        elif c == '9':
            ans += '1'

    print(ans)

main()

Solution (Python):


n = int(input())

n100 = (int)(n / 100)
if n100 == 1:
    n100 = 9
else:
    n100 = 1

n10 = (int)(n / 10) % 10
if n10== 1:
    n10 = 9
else:
    n10 = 1
    
n1 = n % 10
if n1 == 1:
    n1 = 9
else:
    n1 = 1
    
result = n100 * 100 + n10 * 10 + n1
print(result)

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

Solution (Python):
N = list(input())
i = 0
while i < len(N):
    if N[i] == '1':
        N[i] = '9'
    else:
        N[i] = '1'
    i += 1
N = ''.join(N)
print(N)

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

Solution (Python):
number = int(input())
print(111+999-number)

Solution (Python):
word1 = list(input())
word2 = ""
for c in word1:
    if c == "9":
        word2 += "1"
    elif c == "1":
        word2 += "9"
    else:
        word2 += c
print(word2)

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

Solution (Python):
n = input()
chars = list(n)
result = ""
for digit in chars:
    if digit == '9':
        result = result + '1'
    elif digit == '1':
        result = result + '9'
    else:
        result = result + digit

print(result)

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

Solution (Python):
N=input()


A=N.replace('1','A').replace('9','B')
B=A.replace('A','9').replace('B','1')

print(B)

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

Solution (Python):
n = [x for x in str(input())]
add_stock = ''

for i in n:
    add = i
    if i == '1':
        add = '9'
    elif i == '9':
        add = '1'
    add_stock += add

print(add_stock)

Solution (Python):
N = list(map(int, input()))

for i in range(3):
    N[i] = 10 - N[i]

print(str(N[0]) + str(N[1]) + str(N[2]))

Solution (Python):
input_line = input()
print_text = ""

for c in input_line:
    if c == "1":
        c = "9"
    elif c == "9":
        c = "1"
    print_text += c

print(print_text)

Solution (Python):
n = input()
l = [int(x) for x in list(str(n))]
ans = [0,0,0]
for cnt in range(3):
	if l[cnt] == 1:
		ans[cnt] = 9
	elif l[cnt] == 9:
		ans[cnt] = 1
	else:
		ans[cnt] = l[cnt]
ansn =  ans[0] * 100 + ans[1] * 10 + ans[2]
print(ansn)

Solution (Python):
n = int(input())

a = 1110 - n
print(a)

Solution (Python):
import sys
from collections import deque
import copy

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def is_all_same(S):
    pre_s = S[0]
    for s in (S):
        if s != pre_s:
            return False
    return True

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    N = int(input_raw[0])
    S = str(N)
    new_S = ""
    for s in S:
        if s == "9":
            new_S += "1"
        elif s == "1":
            new_S += "9"
        else:
            new_S = s
    print int(new_S)

if __name__ == '__main__':
    main()

Solution (Python):
n = input()

l = [int(x) for x in list(str(n))]

for num in l:
    if num == 1:
        print('9', end='')
    elif num == 9:
        print('1', end='')
    else:
        print('0', end='')

Solution (Python):


n = int(input())

if 111 <= n <1000:
    
        n1 = int (n / 100)


        
        n2 = n - (n1 *100)
        n2 = int (n2 / 10)


        
        n3 = n - n1 *100 - n2*10


        
        if n1 == 9:
            n1 = 1
        elif n1 == 1:
            n1 = 9
        if n2 == 9:
            n2 = 1
        elif n2 == 1:
            n2 = 9
        if n3 == 9:
            n3 = 1
        elif n3 == 1:
            n3 = 9

        nn = n1 *100 + n2*10 + n3

        print(nn)

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

Solution (Python):
n=list(input())
ans=[]
for ni in n:
  if int(ni)==1:
    ans.append("9")
  else:
    ans.append("1")
    
print(int("".join(ans)))

Solution (Python):
n = input()

number = list(n)

for i in range(len(number)):
    if number[i] == "1":
        number[i] = "9"
    elif number[i] == "9":
        number[i] = "1"

ansewer = "".join(number)
        
print(ansewer)

Solution (Python):
n = input()
ans = ''
for w in n:
    if w == '1':
        ans += '9'
    elif w == '9':
        ans += '1'
    else:
        ans += w
print(ans)

Solution (Python):
N=input()
S=0
for i in range(3):
	if N[2-i]=='1':
		S += 9*(10**i)
	else:
		S += 1 * (10**i)
print(S)

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

Solution (Python):
def change(fig):
    sum = 0
    a = 100
    for keta in fig:
        if keta == 1:
            keta = 9
        elif keta == 9:
            keta = 1
        sum += keta * a
        a /= 10
    return sum
        
if __name__ == "__main__":
    n = input()
    fig = list(map(int, list(n)))
    sum = change(fig)
    print(int(sum))

Solution (Python):
n = input()
num = [n[i] for i in range(len(n)) ]

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

n2 = "".join(num)
print(int(n2))

Solution (Python):
A=[]
A=list(input())
B=[]
for i in range(3):
    if A[i]=='1':
        B.append('9')
    else:
        B.append('1')
C=B[0]+B[1]+B[2]
print(C)

Solution (Python):
n=int(input())
if n==111:
    print(999)
elif n==119:
    print(991)
elif n==191:
    print(919)
elif n==199:
    print(911)
elif n==911:
    print(199)
elif n==919:
    print(191)
elif n==991:
    print(119)
elif n==999:
    print(111)

Solution (Python):
N = input()

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

Solution (Python):
A = int(input())

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

Solution (Python):
n = int(input())
if n == 111:
    print(999)
elif n == 119:
    print(991)
elif n == 191:
    print(919)
elif n == 199:
    print(911)
elif n == 911:
    print(199)
elif n == 919:
    print(191)
elif n == 991:
    print(119)
elif n == 999:
    print(111)

Solution (Python):
n = input()

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

Solution (Python):
s = str(input())
s = list(s)
result=''
for i in enumerate(s):
    if i[1]== '9':
        s[i[0]] = '1'
    if i[1] == '1':
        s[i[0]] = '9'
for k in s:
    result += k
print(result,end='')

Solution (Python):
n=int(input())

if n%10==1:
    n=n-1+9
elif n%10==9:
    n=n-9+1
    

if int((n%100)/10)==1:
    n=n-10+90
elif int((n%100)/10)==9:
    n=n-90+10


if int(n/100)==1:
    n=n-100+900
elif int(n/100)==9:
    n=n-900+100

print(n)

Solution (Python):

n = int(input())
print (1110-n)

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

Solution (Python):
n = input()
x = []
for digit in n:
    if digit == "1":
        x.append("9")
    elif digit == "9":
        x.append("1")
print("".join(x))

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

Solution (Python):
n = int(input())
if n >= 900:
    a = 100
    n -= 900
else:
    a = 900
    n -= 100
if n >= 90:
    a += 10
    n -= 90
else:
    a += 90
    n -= 10
if n == 9:
    a += 1
else:
    a += 9

print(a)

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

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

Solution (Python):
n = int(input())
if (n == 999):
   print("111")
elif (n == 991):
    print("119")
elif (n == 911):
    print("199")
elif (n == 919):
    print("191")
elif (n == 199):
    print("911")
elif (n == 191):
    print("919")
elif (n == 199):
    print("911")
elif (n == 119):
    print("991")
elif (n == 111):
    print("999")

Solution (Python):

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

Solution (Python):
num=list(input())
ans=[]
for i in num:
    if i=="1":
        ans.append("9")
    else:
        ans.append("1")

mojiretu = ' '
for x in ans:
    mojiretu += x

print(mojiretu)

Solution (Python):

s=input()
l=list(s)
i=0
while(i<3):
  if(l[i]=="1"):
    l[i]="9"
  elif(l[i]=="9"):
    l[i]="1"
  i+=1
a="".join(l)
print(a)

Solution (Python):
n = input()

n = n.replace("1","ichi")
n = n.replace("9","kyu")

n = n.replace("ichi","9")
n = n.replace("kyu","1")

print(n)

Solution (Python):
n = int(input())

print(1110-n)

Solution (Python):
n = input().strip()

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

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

Solution (Python):
N = input()
n=0
if N == "111":
    n = 999
elif N == "119":
    n = 991
elif N == "199":
    n= 911
elif N == "999":
    n = 111
elif N == "911":
    n = 199
elif N == "991":
    n = 119
elif N == "191":
    n = 919
elif N == "919":
    n = 191

print(n)

Solution (Python):
n = str(input())
newchar = ''

for char in n:
    if (char == '1'):
        newchar += '9'
    else:
        newchar += '1'

print(newchar)

Solution (Python):
n_str = input()
res = 0
for i in range(3):
  s = (10 - int(n_str[i])) * 10**(2-i)
  res = res + s


print(res)

Solution (Python):
def main():
    string = raw_input()
    A = string[0]
    B = string[1]
    C = string[2]
    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)



if __name__ == '__main__':
    main()

Solution (Python):


import sys

input = sys.stdin.readline
a = input().split()
ans = []

a = ','.join(a)
for i in range(3):
    if a[i] == '1':
        ans.append(9)
    else:
        ans.append(1)

print(str(ans[0]) + str(ans[1]) + str(ans[2]))

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

Solution (Python):
num = input()
num = num.replace('1','0')
num = num.replace('9', '1')
num = num.replace('0', '9')
print(num)

Solution (Python):
n = input()
for i in n:
    print(10-int(i),end="")

Solution (Python):
inums = input()

nums = []
for i in inums:
    nums.append(int(i))
o = []
for n in nums:
    if n == 1:
        o.append("9")
    elif n==9:
        o.append("1")
    else:
        o.append(str(n))
print("".join(o))

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

C=len(n)
N=0
for i in range(C):
  if n[i]=='1':
    N+=10**(C-1-i)*9
  else:
    N+=10**(C-1-i)

print(N)

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

abc = str(a)+str(b)+str(c)
print(abc)

Solution (Python):
a = input()
b = []
for i in a:
    if i == '9':
        b.append('1')
    else:
        b.append('9')
for j in b:
    print(j, end="")

Solution (Python):
n = input()

result = ""

for char in n:
 if char is '1':
  result += '9'
 elif char is '9':
    result += '1'

print(result)

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

Solution (Python):
n = raw_input()
result = []
for i in range(0, len(n)):
	if(n[i] == '1'):
		result.append('9')
	elif(n[i] == '9'):
		result.append('1')
	else:
		result.append(n[i])
ans = ''.join(result)
print (ans)

Solution (Python):
n = int(input().strip())

def s19(s):
    if s is '9':
        return '1'
    elif s is '1':
        return '9'
    else:
        return s

ns = ''.join(list(map(s19, str(n))))
print(ns)

Solution (Python):
n = input()

s = list(n)
if n[0] == '1':
    s[0] = '9'
elif n[0] == '9':
    s[0] = '1'
if n[1] == '1':
    s[1] = '9'
elif n[1] == '9':
    s[1] = '1'
if n[2] == '1':
    s[2] = '9'
elif n[2] == '9':
    s[2] = '1'
str_changed = "".join(s)
print(str_changed)

Solution (Python):
num = str(input())
ans = ''
for s in num:
    if s == '1':
        ans += '9'
    else:
        ans += '1'
print(int(ans))

Solution (Python):
n = input()
num = list(n)
for i in range(len(num)):
    if num[i] == "1":
        num[i] = "9"
        continue
    if num[i] == "9":
        num[i] ="1"
        continue

num = ''.join(num)
print(int(num))

Solution (Python):
n = list(map(int, str(input())))

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

print("".join(list(map(str, n))))

Solution (Python):
n = list(input())

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

Solution (Python):


n = str(input())
m = str()

for c in n:
    if c == '1':
        m += '9'
    else:
        m += '1'

print(m)

Solution (Python):
a = list(input())
g = ""
for i in range(len(a)):
    if a[i] == "1":
        a[i] = "9"
    elif a[i] =="9":
        a[i] = "1"
    g += a[i]
print(int(g))

Solution (Python):
n=input()
if(n[0]=='9'):
    m=100
else:
    m=900

if(n[1]=='9'):
    m=m+10
else:
    m=m+90

if(n[-1]=='9'):
    m=m+1
else:
    m=m+9
    
print(m)

Solution (Python):
orig = input()
output = ""
for i in orig:
    if i == "1":
        output += "9"
    elif i == "9":
        output += "1"
print(output)

Solution (Python):
n = list(input())

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

print(''.join(output))

Solution (Python):
n = input()

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

print(n)

Solution (Python):
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(map(str, l)))

Solution (Python):
n=input()
s=""
for i in n:
    if i=="1" or i=="9":
        s+=["1","9"][i!="9"]
    else:
        s+=i
print(s)

Solution (Python):
n = input()
k = ""
for i in n:
	if i =="1":
		k = k + "9"
	if i =="9":
		k = k + "1"

print(k)

Solution (Python):
n = int(input())
num =[]
for i in range(3):
  num.append(int(n%10))
  n /= 10
if(num[0] == 1):
  num[0] = 9
elif(num[0] == 9):
  num[0] = 1
if(num[1] == 1):
  num[1] = 9
elif(num[1] == 9):
  num[1] = 1
if(num[2] == 1):
  num[2] = 9
elif(num[2] == 9):
  num[2] = 1
print(num[0]+num[1]*10+num[2]*100)

Solution (Python):
s = int(input())

print(1110 - s)

Solution (Python):
s=list(input())


a = 0
while a < 3:
  if s[a] == "1":
    s[a] = "9"
  elif s[a] == "9":
    s[a] = "1"
  a += 1

s = ''.join(s)


print(s)

Solution (Python):
import math
s = input()
ans = ""
for i in range(3):
    if s[i]=="1":
        ans+="9"
    if s[i] == "9":
        ans+="1"
print(ans)

Solution (Python):
S = input()
print(S.replace("9", "a").replace("1", "9").replace("a", "1"))

Solution (Python):

n = int(input())

x = 1110 - n
print(x)

Solution (Python):
import numpy as np

x = input()
x = str(x)
y = 0
z = len(x)
for i in range(z):
  if x[i] == '1':
    y = y + 9 * (10 ** (z - i - 1))
  else:
    y = y + 1 * (10 ** (z - i - 1))
print(y)

Solution (Python):
n = int(input())
N = str(n)
array = list(map(int, list(N)))
for i in range(0, len(array)):
    if array[i] == 1:
        array[i] = 9
    elif array[i] == 9:
        array[i] = 1
print(array[0], end = '')
print(array[1], end = '')
print(array[2])

Solution (Python):
n = list(input())

ans = ''

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

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

Solution (Python):
import numpy as np

n = int(input())

ans = 0

if n % 10 == 9:
    ans += 1
else:
    ans += 9
n = int(n/10)


if n % 10 == 9:
    ans += 10
else:
    ans += 90
n = int(n/10)
if n % 10 == 9:
    ans += 100
else:
    ans += 900


print(ans)

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

Solution (Python):
c=list(input())
ans=str()
ans=str()
for i in range(len(c)):
    if c[i]=='9':
        c[i]='1'
    else:
        c[i]='9'
        
    ans+=c[i]
    
print(int(ans))

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

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

print('')

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

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

Solution (Python):
numList=list(input())

ansList=[]
for i in numList:
  if(i=="1"):
    ansList.append("9")
  else:
    ansList.append("1")

ans=""
for j in ansList:
  ans+=j

print(int(ans))

Solution (Python):
import sys

n = input()
ans = ""

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

    else :
        ans+='9'

print(ans)

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

for i in range(len(a)):
    print(a[i] ,end="")

Solution (Python):
n = input()

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

Solution (Python):



input = raw_input()

result = ""
for i in range(0, 3):
    if input[i] == "1":
        result += "9"
    elif input[i] == "9":
        result += "1"
    else:
        result += input[i]

print int(result)

Solution (Python):
s = input()
s = s.replace("1","2")

s = s.replace("9","1")

s = s.replace("2","9")

print(s)

Solution (Python):
s = raw_input().strip()
t = ''
for c in s:
    if c == '1': t += '9'
    elif c == '9': t += '1'
    else: t += c
print t

Solution (Python):
num = input()
res = 0
for i in range(3):
    if num[i] == "1":
        res += 9 * (10**(2-i))
    else:
        res += 1 * (10**(2-i))
print(res)

Solution (Python):
n = input()
a = ""
for i in n:
    if i=="1":
        a += i.replace("1","9")
    elif i=="9":
        a += i.replace("9","1")
    else:
        a += i
print(a)

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

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

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

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

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

Solution (Python):
N = input()

ans = ""

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

print(ans)

Solution (Python):
import sys 

n = str(input())
ans = ''
for num in n:
  if num == '1':
    ans += '9'
  elif num == '9':
    ans += '1'
print(ans)

Solution (Python):


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

Solution (Python):
N = str(input())
print(N.replace('1','4').replace('9','1').replace('4','9'))

Solution (Python):
n = int(input())
if n % 10 == 1:
    m = 9
else:
    m = 1
n //= 10
if n % 10 == 1:
    m += 90
else:
    m += 10
n //= 10
if n % 10 == 1:
    m += 900
else:
    m += 100
print(int(m))

Solution (Python):



def main():
    n = input()

    res = ""
    for c in n:
        if c == "1":
            res += "9"
        else:
            res += "1"
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):
ans=[]
ans2=[]
n=int(input())
a=n//100
b=(n-a*100)//10
c=n-a*100-b*10
ans.append(a)
ans.append(b)
ans.append(c)
for i in ans:
    if i==1:
        ans2.append(str(9))
    else:
        ans2.append(str(1))
print(''.join(ans2))

Solution (Python):
N = int(input())
M=1110-N
print(M)

Solution (Python):
n = input()
m = ''
a = str(10 - int(n[0]))
b = str(10 - int(n[1]))
c = str(10 - int(n[2]))
print(a+b+c)

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

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

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

Solution (Python):


 
def main(nums):
 
	ref = '1'*len(nums)+'0'
 
 
	return int(ref)-int(nums)
 
 
 
 
nums = input()
print(main(nums))

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

Solution (Python):
n = input()

l = []

n=str(n)

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

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

Solution (Python):
S = input()
R = ''

for s in S:
    if s == '1':
        R += '9'
    elif s == '9':
        R += '1'
    else:
        R += s

print(R)

Solution (Python):
N = input()

ans =''

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

print(ans)

Solution (Python):
num = input()
x = [int(i) for i in num]
for i in range(len(x)):
    if x[i] == 1:
        x[i] = "9"
    else:
        x[i] = "1"
mojiretu = ''.join(x)
print(int(mojiretu))

Solution (Python):
a = str(input())
b = ''
for i in a:
    if i == '9':
        b += '1'
    else:
        b += '9'
print(int(b))

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

Solution (Python):
n=input()
n=n.replace("9","@").replace("1","_")
n=n.replace("@","1").replace("_","9")
print(n)

Solution (Python):


N = input()


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

Solution (Python):
n = input()

result = ''

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

Solution (Python):
n = input()
res = str()

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

Solution (Python):


n = list(str(input()))

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

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

print("".join(n))

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

Solution (Python):



def main():
    s = input()
    mod = ''

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

    print(mod)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
print(abs(1110-n))

Solution (Python):
a = input()
l = [int(x) for x in list(str(a))]
s = ""
for i in l:
  if i == 1:
    s += "9"
  elif i == 9:
    s += "1"
print(int(s))

Solution (Python):



n = input()
m = n.replace('1', '_').replace('9', '1').replace('_', '9')
print(int(m))

Solution (Python):

a = int(input())

print(1110 - a)

Solution (Python):
print(1110-int(input()))

Solution (Python):
print(input().translate(str.maketrans("19", "91")))

Solution (Python):
n = str(input())

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

print(ans)

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

Solution (Python):
def main():
    N = input()
    out = ""
    for i in range(3):
        n = N[i]
        if n == "1":
            out += "9"
        elif n == "9":
            out += "1"
        else:
            out += n
    return out

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

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

print(''.join(m))

Solution (Python):
n=list(input())
l=[]
for i in range(len(n)):
  l.append(str(10-int(n[i])))
l=''.join(l)
print(l)

Solution (Python):
n = input()

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

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

Solution (Python):
n = input()
m =n.replace("1","a")
o =m.replace("9","b")
p =o.replace("a","9")
q =p.replace("b","1")
print(int(q))

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

Solution (Python):

print(1110 - int(input()))

Solution (Python):



def main():
    n = raw_input()
    ans = ""
    for i, alp in enumerate(n):
        if alp == "1":
            ans += "9"
        elif alp == "9":
            ans += "1"
        else:
            ans += alp

    print(ans)


if __name__ == "__main__":
    main()

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

Solution (Python):
def main():
    n = input()
    result = ""
    for i in n:
        if i == "1":
            i = "9"
        else:
            i = "1"
        result += i
    print(result)


if __name__ == '__main__':
    main()

Solution (Python):
A_list = list(input())
ans = []
for a in A_list:
    if a == '1':
        ans.append('9')
    if a == '9':
        ans.append('1')

answer = ''
for x in ans:
    answer += x
print(answer)

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

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

Solution (Python):
n = input()

s = ""

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

print(s)

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

Solution (Python):
n=input()

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

print(n)

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

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

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

print(ans)

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

Solution (Python):
n = int(input())

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

Solution (Python):
n=input()

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

print(int(n))

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

Solution (Python):
n = input()

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

print(ans)

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

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

Solution (Python):


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

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

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

Solution (Python):




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

Solution (Python):


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)

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

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

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

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

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

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