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

print("".join(n))

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

Solution (Python):
n = input()

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

print(ans)

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

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

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=int(input())
print(1110-n)

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

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

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

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

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

Solution (Python):
n=input()
ans=[]
for i in range(len(n)):
        if n[i]=="9":
                ans.append(1)
        else:
                ans.append(9)
print(*ans,sep="")

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

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

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

Solution (Python):
n = input()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

print(n)

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

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

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


if __name__ == '__main__':
    solve()

Solution (Python):
n = input()

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

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

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

Solution (Python):
n = input()

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

print(n.translate(table))

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

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

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

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

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

Solution (Python):


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)

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

Solution (Python):
n = input()

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

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

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

Solution (Python):
N = input()

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

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

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

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

print(answer)

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

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

print("".join(n))

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

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

Solution (Python):
arg = input()

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

print(res)

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

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

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

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

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

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

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

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

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

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

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

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)

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

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

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

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

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

Solution (Python):
s=str(input())
S=list(s)
t=''
for i in range(3):
  if S[i]=='1':
    t+='9'
  else:
    t+='1'
print(t)

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

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

print(''.join(N))

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

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

print(*ans, sep="")

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

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

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

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

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

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

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

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

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

print(ans)

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

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

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

ans = ""

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

print(ans)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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'
        
for i in n:
    print(i, end ="")

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

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

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

Solution (Python):




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

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'

print(''.join(n))

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

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

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

Solution (Python):
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
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

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

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

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

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

print(ans)

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

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

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

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

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

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

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

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

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

print(ans)

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

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

print(1110-N)

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

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

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

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

Solution (Python):
n = input()

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

print(new_n)

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

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

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

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

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

Solution (Python):
n = list(input())
ans = []

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

print(*ans, sep='')

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

Solution (Python):
S = input()

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

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

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

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

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

Solution (Python):
"""
author : halo2halo
date : 22, Jan, 2020
"""

import sys



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

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

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

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

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

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

Solution (Python):
n=input()

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

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

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

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

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

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

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


print(''.join(n))

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

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

Solution (Python):


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

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

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

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

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

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

Solution (Python):
def main():
    n = list(input())
 
    if n[0] == '1':
        n[0] = '9'
    else:
        n[0] = '1'
 
    if n[1] == '1':
        n[1] = '9'
    else:
        n[1] = '1'
 
    if n[2] == '1':
        n[2] = '9'
    else:
        n[2] = '1'
 
    print(''.join(n))
 
main()

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

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

Solution (Python):
def main():
    from sys import stdin
    r = stdin.readline()[:-1]
    
    
    

    res = ""
    for i in r:
        if i == '1':
            res += '9'
        else:
            res += '1'
    print(res)
   
if __name__ == '__main__':
    main()

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"

print("".join(n))

Solution (Python):
s = input()
li = ['']*3
for i in range(len(s)):
    if s[i]=='1':
        li[i]='9'
    elif s[i]=='9':
        li[i]='1'
    else:
        li[i]=s[i]
print(''.join(li))

Solution (Python):
s = input()
r = 0
if s[0] == '1':
  r += 900
else:
  r += 100
if s[1] == '1':
  r += 90
else:
  r += 10 
if s[2] == '1':
  r += 9
else:
  r += 1 
print(r)

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

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

print("".join(n))

Solution (Python):
n = input()

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

print(n)

Solution (Python):
s=input()
print(s.replace("1","0").replace("9","1").replace("0","9"))

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

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

Solution (Python):
s=input()
A=[]
for i in s:
  if i=='9':
    A.append('1')
  elif i=='1':
    A.append('9')
  else:
    A.append(str(i))

a=''.join(A)
print(a)

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

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

print(r)

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

Solution (Python):
import sys

n = sys.stdin.readline().rstrip()

def main():
    res = n.replace('9', '0')
    res = res.replace('1', '9')
    res = res.replace('0', '1')
    return res

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

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

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

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

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

    print(''.join(n))

main()

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

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

print(''.join(n))

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

Solution (Python):
n = input()

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

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

def swap(char, a, b):
    if char == a:
        return(b)
    if char == b:
        return(a)

res = list(map(lambda x: swap(x, "1", "9"), text))
print("".join(res))

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

Solution (Python):
a=input()
b=""
for i in range(3):
  if a[i]=="1":
    b+='9'
  else:
    b+='1'
print(b)

Solution (Python):
z=input()
l = len(z)
char_list =list(z)
for i in range(int (l)):
  if char_list[i]=="1":
    char_list[i]="9"
  elif char_list[i]=="9":
    char_list[i]="1"
s = ""
for i in range(int (l)):
  s=s+char_list[i]
print(s)

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=input()
s=""
for i in n:
  if i=="9":
    s=s+"1"
  else:
    s=s+"9"

print(s)

Solution (Python):
n = input()

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

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

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

Solution (Python):
print(input().replace("1", "

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

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

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

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

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

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

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

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

Solution (Python):
n=input()
a,b,c=10-int(n[0]),10-int(n[1]),10-int(n[2])
print(100*a+10*b+c)

Solution (Python):
import sys
input = sys.stdin.readline
na = input()
n = ['8'] * 3
for i in range(3) :
    n[i] = na[i]
for i in range(3) :
    if n[i] == '1' :
        n[i] = '9'
        continue
    elif n[i] == '9' :
        n[i] = '1'
N = 0
for i in range(3) :
    k = int(n[i])
    N += k * 10 ** (2-i)
print(N)

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

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

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

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

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

Solution (Python):
import os
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


n = sys.stdin.buffer.readline().decode().rstrip()
for a in n:
    if a == '9':
        print(1, end='')

    if a == '1':
        print(9, end='')
print()

Solution (Python):


num = input().rstrip()

num = num.replace("9", "2")
num = num.replace("1", "9")
num = num.replace("2", "1")
print(num)

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

Solution (Python):
n=input()
a=[]
for i in range(len(n)):
  if n[i]=="1":
    a.append("9")
  else:
    a.append("1")
print(a[0]+a[1]+a[2])

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

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

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

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

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

for i,s in enumerate(n):
  if s=="1":
    n[i]="9"
  elif s=="9":
  	n[i]="1"

print(*n,sep="")

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

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