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-----
119

-----Sample Output-----
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.

Difficulty: introductory

Starter code:

Solutions:
s = list(input())

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

t = ''
for i in range(3):
  t += s[i]
  
print(t)

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


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

a=input()
print(a.replace("1","8").replace("9","1").replace("8","9"))

#!/usr/bin/env python3


def main():
    N = input()

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


def __starting_point():
    main()

__starting_point()

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

print(ans)

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

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

N = input()
print((N.replace("1", ".").replace("9", "1").replace(".", "9")))


s = input()

ans = ''
for w in s:
  if w == '1':
    ans += '9'
  else:
    ans += '1'
    
ans = int(ans)
print(ans)

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


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

#ABC111A
n = input()
print(n.replace("1","x").replace("9","1").replace("x","9"))

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


main()

n=int(input())
if (n-n%100)/100==1:
    n+=800
else:
    n-=800

if (n%100-(n%100)%10)/10==1:
    n+=80
else:
    n-=80

if n%10==1:
    n+=8
else:
    n-=8
print(n)




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

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

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

print(''.join(map(str, new_list)))

a=input()
print(a.replace("1","x").replace("9","1").replace("x","9"))

s = input()
s_list=list(s)
for i in range(len(s)):
  if s[i] == "1":
    s_list[i]='9'
  elif s[i]=="9":
    s_list[i]='1'
str_changed="".join(s_list)
print(str_changed)


n=list(input())
for i in range(3):
    if n[i]=="1":
        n[i]=9
    else:
        n[i]=1
print(n[0],n[1],n[2],sep="")

a = input()

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

print(a)

n = input()

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

n = input()

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


print((int(n)))


n = input()
for c in n:
  print(10-int(c),end='')
print()

n = input()
x = list()
for i in range(3):
    if n[i] == "1":
        x.append("9")
    else:
        x.append("1")
print(x[0] + x[1] + x[2])

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


a = input()
l1 = []
l2 = []
for i in range(len(a)):
  l1.append(a[i:i+1])
for i in range(len(a)):
  l2.append(str(abs(int(l1[i]) - 10)))
print("".join(l2))

f = lambda c : "1" if c == "9" else "9"
  
print(''.join(list(map(f, input()))))

N = input() #1行目のNを取得
N=N.translate(str.maketrans({'1': '9', '9': '1'}))
print(int(N))

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

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

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

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

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


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

# coding: UTF-8
import sys
import numpy as np
import math


sList = list(str(input()))
for i in range(3):
	if sList[i] == "1":
		sList[i] = "9"
	else:
		sList[i] = "1"

print("".join(sList))

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

S = input()
new_s=''
for s in S:
       if s=="1":new_s+="9"
       else:new_s+="1"
print(new_s)

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

a = list(input())

for i in range (0, len(a)):
    if a[i] == "1":
        a[i] = "9"
    elif a[i] == "9":
        a[i] = "1"
    print(a[i], end = "")


url = "https://atcoder.jp//contests/abc111/tasks/abc111_a"

def main():
    s = input()
    print((s.translate(str.maketrans({'1': '9', '9': '1'}))))
    
    
def __starting_point():
    main()


__starting_point()

print(1110-int(input()))

a = input()
print(a.replace('1', 'x').replace('9', '1').replace('x', '9'))

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

n=input()
ans=n.replace('1','q').replace('9','i').replace('q','9').replace('i','1')
print(ans)

n=input()

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

print(''.join(ans))

print(input().replace('1', 'a').replace('9', '1').replace('a', '9'))

n = input()
result = ''
for i in n:
    if i == '1':
        result += '9'
    elif i == '9':
        result += '1'

print(result)

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



n = input()
n01 = n.replace('1', 'x')
n02 = n01.replace('9', 'y')
n03 = n02.replace('x', '9')
n04 = n03.replace('y', '1')
print(n04)

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

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

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

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

a = input()
x = ""
if a[0] == "1":
    x += "9"
else:
    x += "1"
if a[1] == "1":
    x += "9"
else:
    x += "1"
if a[2] == "1":
    x += "9"
else:
    x += "1"
print(x)

a=int(input())
if (a//100)%9==0:
  b=100
else:
  b=900
if ((a-(a//100)*100)//10)%9==0:
  c=10
else:
  c=90
if (a-(a//10)*10)%9==0:
  d=1
else:
  d=9
print(b+c+d)

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

n = input()

m = ""

for x in n:
    if x == "1":
        m += "9"
    elif x == "9":
        m += "1"
    else:
        m += x

print(int(m))

n = int(input())
lst_n = list(str(n))
for i in range(len(lst_n)):
    if lst_n[i] == '1':
        lst_n[i] = '9'
    elif lst_n[i] == '9':
        lst_n[i] = '1'
print(''.join(lst_n))

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


n = int(input())

print(1110 - n)

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

n = input()
s = ''

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

print(s)  

n = input()
ans = ''

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

print(ans)

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


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

n = input()
out = ''
for s in n:
    if s == '1':
        out += '9'
    else:
        out += '1'
print(out)

n = str(input())
N = n.replace('9','x').replace('1','9').replace('x','1')
print(N)

n = list(input())

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

print(''.join(n))

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


# ABC111
# A AtCoder Beginner Contest999
n = list(input())
for i in range(len(n)):
    if n[i] == "1":
        n.pop(i)
        n.insert(i, "9")
    elif n[i] == "9":
        n.pop(i)
        n.insert(i,"1")
print((int("".join(n))))


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

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

n = input()
n_list = list(n)
for i in range(3):
    
    if n_list[i] == '1':
        n_list[i] = '9'
    elif n_list[i] == '9':
        n_list[i] = '1'
n_c = "".join(n_list)
print(n_c)

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

a=input()
print(a.replace('1','x').replace('9','1').replace('x','9'))

n=input()
i=0
a=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=1
b=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
i=2
c=n[i].replace('1', '9') if n[i]=='1' else n[i].replace('9', '1')
print(a+b+c)

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

n=list(input())

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

for j in range(3):
  S+=n[j]
print(S)

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

a = input()
print(a.replace("1", "x").replace("9", "1").replace("x", "9"))

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


print(input().replace('1','0').replace('9','1').replace('0','9'))

s = list(input())
def slv(i):
    if i == 1 or i == 9:
        return 10-i
    else:
        return i
print(str(slv(int(s[0])))+str(slv(int(s[1])))+str(slv(int(s[2]))))

print(1110 - int(input()))

print(1110-int(input()))

n = input()

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

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

n = list(input())
ans = ''

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

print(ans)


moji = str(input())
ans = ""
for i in range(len(moji)):
    ans += ("1","9")[moji[i]=="1"]
print(ans)

n = str(input())

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

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

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

print(1110-int(input()))

n = input()

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

print(int(n))

num_str = input()
print((num_str.replace('1', 'x').replace('9', '1').replace('x', '9')))


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

S = input()

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

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