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



def main():
    n = input()
    ans = ''

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

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
from functools import reduce

N = int(input())
N_list = [int(x) for x in list(str(N))]

N_ = []
for i in N_list:
    if i == 1:
        i = 9
    elif i == 9:
        i = 1
    N_.append(i)

new_N = int(reduce(lambda x,y: x+y, [str(x) for x in N_]))

print(new_N)

Solution (Python):
n = input()
n = n.replace('1', 'a').replace('9', '1').replace('a', '9')
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):
print("".join({"1":"9", "9":"1"}[i] for i in input()))

Solution (Python):
text = input()
str = ['1' if c == '9' else '9' for c in text]
print(''.join(str))

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

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


if __name__ == '__main__':
    main()

Solution (Python):
N = input()
string = ['1' if c == '9' else '9' for c in N]
print(''.join(string))

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

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

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

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

Solution (Python):
n = input()
r = [10 - int(n[i]) for i in range(3)]
print("".join(map(str, r)))

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

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

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

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

Solution (Python):
a = input()
ans=''

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

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

Solution (Python):
n=int(input())
N=0
i=0
while n>0:
    if n%10==1:
        N+=9*10**i
    else:
        N+=1*10**i
    n//=10
    i+=1
print(N)

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

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


print(n.translate(table))

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

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

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

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

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

Solution (Python):
N=input()

str_output=""

for i in range(3):
    if(N[i]=="1"):
        str_output+="9"
    elif(N[i]=="9"):
        str_output+="1"
        
print(int(str_output))

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

Solution (Python):
n = input()

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

print(answer)

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

Solution (Python):
n = int(input())
n_s = str(n)
digit = 100
for i in range(len(n_s)):
  n = n+8*digit if n_s[i] == '1' else n-8*digit
  digit = digit/10
print(int(n))

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

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

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

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

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

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

Solution (Python):

n = str(input())
S = n.replace("1","8")
T = S.replace("9","1")
U = T.replace("8","9")
print(U)

Solution (Python):
n = input()
result = []
for i in n:
    if i == "1":  i = "9"
    else:       i = "1"
    result.append(i)

print(int("".join(result)))

Solution (Python):
n = input()
ans = ''
for s in n:
    ans += str(10-int(s))
print(ans)

Solution (Python):


n=input()

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

print(int(n))

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

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

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

Solution (Python):



def main():
    """Function."""
    s = str(input())
    s1, s2, s3 = "", "", ""
    if s[0] == "1":
        s1 = "9"
    else:
        s1 = "1"
    if s[1] == "1":
        s2 = "9"
    else:
        s2 = "1"
    if s[2] == "1":
        s3 = "9"
    else:
        s3 = "1"
    print(s1+s2+s3)


if __name__ == "__main__":
    main()

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

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

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

Solution (Python):
if __name__ == '__main__':
    n = str(raw_input())
    ans = ''
    for ch in n:
        if ch == '1':
            ans += '9'
        else:
            ans += '1'
    print ans

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

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

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

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

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

Solution (Python):
n=list(input())
p=""
for i in range(len(n)):
    n[i]=10-int(n[i])
    p+=str(n[i])
print(p)

Solution (Python):
s = input().rstrip()
ans = ''
for c in s:
    if c == '1':
        ans += '9'
    else:
        ans += '1'
print(ans)

Solution (Python):
n = input()

for i in range(len(n)):
    t = int(n[i])
    if t == 9 :
        print(1,sep="",end="")
    else:
        print(9,sep="",end="")

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

Solution (Python):
n = input()
print(''.join(map(lambda c: '9' if c == '1' else '1' if c == '9' else c, n)))

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

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

Solution (Python):
n = input()
for keta_str in n:
    keta = int(keta_str)
    if keta == 1:
        keta = 9
    else:
        keta = 1

    print(keta, end='')

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

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

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

Solution (Python):
N = list(input())
num = 0
for i in N:
    if i == "1":
        N[num] = "9"
        num +=1
        continue
    elif i == "9":
        N[num] = "1"
        num += 1
        continue
N = "".join(N)
print(N)

Solution (Python):
def abc111_a():
    n = int(input())
    return 1110 - n


print(abc111_a())

Solution (Python):

def replace(a):
	if a=="9":
		return "1"
	elif a=="1":
		return "9"
	else:
		return a
num=raw_input()
num1="".join(map(replace,num))
print(int(num1))

Solution (Python):

num = int(input())

ans = ''

n = list(str(num))

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

print(ans)

Solution (Python):

from sys import stdin

s_in = lambda: stdin.readline()[:-1]  


def replace_digits(x):
    if x == '1':
        return '9'
    else:
        return '1'

n = s_in()
ans = ''
for x in list(n):
    ans += replace_digits(x)
print(ans)

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

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

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

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

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

Solution (Python):
if __name__ == '__main__':
    S = input()
    ans = "".join(["9" if s == "1" else "1" for s in S])
    print(ans)

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

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

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

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

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

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

print(ans)

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

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

if __name__ == "__main__":
    main()

Solution (Python):
def main():
    n = input()
    l = str(n)
    
    ans = ""
    for m in l:
        if m == "1":
            ans += "9"
        elif m == "9":
            ans += "1"
        else:
            ans += m
    print(ans)

if __name__ == "__main__":
    main()

Solution (Python):

def solve():
    print(str(input()).translate(str.maketrans({'1': '9', '9': '1'})))


if __name__ == '__main__':
    solve()

Solution (Python):

def solve():
    anstr = ""
    s = input()
    for ch in s:
        if ch is '1':
            anstr += '9'
        elif ch is '9':
            anstr += '1'
        else:
            anstr += ch
    print(anstr)


if __name__ == '__main__':
    solve()

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

Solution (Python):
a=input()

a=list(a)



for i in range(3):
    if(a[i]=='1'):
        a[i]='9'
    elif(a[i]=='9'):
        a[i]='1'
s=''.join(a)

print(s)

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

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

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

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

Solution (Python):
m = {'1': '9', '9': '1'}
n = int(input())
for i in str(n):
    print(m[i], end='')

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

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

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

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

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

for i in range(len(n)):
    n[i] = 10 - n[i]
    n[i] = str(n[i])

a = "".join(n)
print(a)

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

Solution (Python):
char = input()
chars = list(char)

for cha in chars:
  if cha == "1":
    cha = "9"
  elif cha == "9":
    cha = "1"
  print(cha, end="")

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

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

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

Solution (Python):

N = list(input())

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

print(out_str)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**13
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    s = S()
    t = s.replace('9', '2').replace('1', '9').replace('2', '1')

    return t


print(main())

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

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

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

Solution (Python):
n = str(input())
ne = n.replace('1', '&')
new = ne.replace('9', '1')
newn = new.replace('&', '9')
print(newn)

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

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

print(ans)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b



def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)



def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


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

if __name__ == '__main__':
    main()

Solution (Python):
n = input()
m = list(n)
r = []

for i in range(3):
    if m[i] == "1":
        m[i] = "9"
        r.append(m[i])
    elif m[i] == "9":
        m[i] ="1"
        r.append(m[i])
    else:
        r.append(m[i])

print(int("".join(r)))

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

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

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

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

Solution (Python):

import math


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

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

a=n//100
n=n-a*100

if a==1:
	a=9
elif a==9:
	a=1

b=n//10
n=n-b*10

if b==1:
	b=9
elif b==9:
	b=1
	
if n==1:
	n=9
elif n==9:
	n=1

ans=a*100+b*10+n

print(ans)

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

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

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

Solution (Python):
n = input()

ans = ''
for i, v in enumerate(n):
    if v == '9':
        ans += '1'
    elif v == '1':
        ans += '9'
    else:
        ans += v

print(ans)

Solution (Python):
import sys


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


main()

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

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

print()

Solution (Python):
'''
問題文
	猫のすぬけは文字を書く練習をしています。 すぬけは今日、数字の 1 と 9 を書く練習をしていたのですが、 間違えて 1 と 9 をあべこべに書いてしまいました。
	すぬけが書いた 3 桁の整数 n が与えられます。 
	n に含まれる 1 という桁をそれぞれ 9 に、 9 という桁をそれぞれ 1 に置き換えて得られる整数を出力してください。

制約
	111 ≤ n ≤ 999
	n は各桁が 1 か 9 である整数

入力
	入力は以下の形式で標準入力から与えられる。
	n

出力
	n の各桁の 1 と 9 を入れ替えた整数を出力してください。

入力例 1 
	119
出力例 1 
	991
	一の位の 9 を 1 に、十の位の 1 を 9 に、百の位の 1 を 9 に書き換えた 991 が答えとなります．

入力例 2 
	999
出力例 2 
	111
'''

def main():
	'''
	メイン関数
	'''
	
	input_num = input()
	
	
	input_num = input_num.replace('1','-')
	input_num = input_num.replace('9','1')
	input_num = input_num.replace('-','9')
	print(input_num)



if __name__ == '__main__':
	main()

Solution (Python):
n=int(input())
if(n//100==9):
    n-=800
else:
    n+=800
if((n//10)%10==9):
    n-=80
else:
    n+=80
if(n%10==9):
    n-=8
else:
    n+=8


print(n)

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

Solution (Python):
n=input()
m=0
for i in range(3):

    if n[2-i]=="1":
        m+=9*(10**i)

    elif n[2-i]=="9":
        m+=1*(10**i)
    
    else:
        m+=int(n[2-i])*(10**i)
print(m)

Solution (Python):
str_input = input()

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

print(str_input)

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

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

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

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

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

Solution (Python):
a=input()
b=a.replace("1","2")
c=b.replace("9","8")
d=c.replace("2","9")
e=d.replace("8","1")
print(e)

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

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

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

Solution (Python):
N=input().strip()
a=''

for i in range(3):
    if N[i]=='1':
        a=a+'9'
    elif N[i]=='9':
        a=a+'1'
        
print(int(a))

Solution (Python):
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(n[0] + n[1] + n[2])

Solution (Python):
n = input()
j = [int(x) for x in list(str(n))]
for i in range(3):
    if j[i] == 1:
        j[i] = 9
    else:
        j[i] = 1

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

Solution (Python):
N=input()

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

Solution (Python):
n = input()
dst = n.translate(n.maketrans('19', '91'))
print(dst)

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

Solution (Python):
n = input()
ans = []
for index in range(3):
    ans.append('9' if '1' == n[index] else '1')
print("{n0}{n1}{n2}".format(n0=ans[0], n1=ans[1], n2=ans[2]))

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

n2 = int(n2)
print(n2)

Solution (Python):

s = list(input())
for j,i in enumerate(s):
    if i == '1':
        s[j] = '9'
    elif i == '9':
        s[j] = '1'


print(''.join(s))

Solution (Python):
n = list(map(int, input()))
ans = 0
x = 100
for i in range(len(n)):
    if i == 1:
        x = 10
    if i == 2:
        x = 1
    if n[i] == 9:
        ans += x * 1
    elif n[i] == 1:
        ans += x * 9
else:
    print(ans)

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

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

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

print(''.join(n_list))

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

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

Solution (Python):
n = input()
result = []

if n[0] == "1":
    result.append("9")
else :
    result.append("1")    

if n[1] == "1":
    result.append("9")
else :
    result.append("1")    

if n[2] == "1":
    result.append("9")
else :
    result.append("1") 
print("{}{}{}".format(result[0],result[1],result[2]))

Solution (Python):
n = list(map(int,list(input())))
a = []

for i, code in enumerate(n):
    if code == 1:
        code = 9
        
    elif code == 9:
        code = 1

    a = a + [code]
    
a = list(map(str,a))
b = "".join(a)
print(b)

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

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

Solution (Python):
print(''.join(map(lambda c: '1' if c == '9' else '9', input())))

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 = raw_input()
print int(len(n)*"1"+"0") - int(n)

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

Solution (Python):
a=int(input())
b=1110-a
print(b)

Solution (Python):
arr=[]
arr19=['1','9']
n=int(input())
if(n>=111 and n<=999):
    arr=list(str(n))
output=""
for i in range(3):
    if arr[i] in arr19 :
        output+=str(10-int(arr[i]))
print(output)

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

Solution (Python):
print(*map("0923456781".index, input()),sep='')

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

Solution (Python):
N=int(input())
n=list(map(int,str(N)))
for i in range(3):
    if n[i]==1:
        n[i]=9
    elif n[i]==9:
        n[i]=1
print(n[0]*100+n[1]*10+n[2])

Solution (Python):


def transform (bango):
    if bango == "1":
        return "9"
    elif bango == "9":
        return "1"
    else:
        return bango

def solve(string):
    return "".join(list(map(transform, string)))

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

Solution (Python):
import math as M
n=input()
answer=0
for i in range(3):
    if n[i]=='9':
        answer+=10**(2-i)
    else:
        answer+=9*10**(2-i)
print(answer)

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

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

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

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

print(1110-n)

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

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

print(1110 - n)

Solution (Python):
N = list(input())
for i in range(len(N)):
  if N[i] is '1':
    N[i] = '9'
  else:
    N[i] = '1'
print(N[0] + N[1] + N[2])

Solution (Python):
i = str(raw_input())
print i.replace('9', 'n').replace('1', '9').replace('n', '1')

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

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

Solution (Python):
num = int(input())
num = [int(c) for c in list(str(num))]
num[0] = 10-num[0]
num[1] = 10-num[1]
num[2] = 10-num[2]
print(num[0],end="")
print(num[1],end="")
print(num[2])

Solution (Python):
num = []
n = input()

while n!= 0:
  num.append(n%10)
  n /= 10
num.reverse()



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


ans = ""
for j in range(len(num)):
  ans += str(num[j])
print(ans)

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

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

result = n.replace('1', '2').replace('9','1').replace('2','9')

print(result)

Solution (Python):
number = input()
result = number.replace('1', 'hoge').replace('9', '1').replace('hoge', '9')
print(result)

Solution (Python):
number = input()

number_list = []

for i in number:
	if i == '1':
		number_list.append(9)
	else:
		number_list.append(1)


result = ''.join([str(x) for x in number_list])

print(result)

Solution (Python):

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

Solution (Python):
n = input()
length = len(n)
n_list = list(n)
ans = ''

for i in range(length):
    if n_list[i] == '1':
        n_list[i] = '9'
    elif n_list[i] == '9':
        n_list[i] = '1'
    ans+=n_list[i]

print(ans)

Solution (Python):
n = input()
length = len(n)
n_list = list(n)
ans = ''

for i in range(length):
    if n_list[i] == '1':
        n_list[i] = '9'
    elif n_list[i] == '9':
        n_list[i] = '1'
    ans+=n_list[i]

print(ans)

Solution (Python):
def chg(n):
  if n==1:
    return 9
  elif n==9:
    return 1
  return n

n = int(input())
n,a1 = divmod(n,10)
n,a2 = divmod(n,10)
n,a3 = divmod(n,10)


print(100*chg(a3)+10*chg(a2)+chg(a1))

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

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

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

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

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



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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
N = list(input())
N = ["a" if num == "1" else num for num in N]
N = ["1" if num == "9" else num for num in N]
N = ["9" if num == "a" else num for num in N]
N = "".join(map(str, N))

print(int(N))

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

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

Solution (Python):


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


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

Solution (Python):
def solve(n):
    res = ""
    while n > 0:
        res = ("9" if (n % 10 == 1) else "1") + res
        n /= 10
    return res

assert solve(119) == "991"
assert solve(999) == "111"
print solve(input())

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

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

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

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

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

Solution (Python):

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

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

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

num_li = []
for i in range(3):
    tmp = n % 10
    n = n // 10
    if tmp == 1:
        num_li.append(9)
    else:
        num_li.append(1)

multi = 1
n = 0
for i in range(len(num_li)):
    n = n + num_li[i] * multi
    multi *= 10

print(n)

Solution (Python):
n = int(input())
n1 = n//100
n2 = n//10 - n1*10
n3 = n - n1*100 -n2*10

if n1 == 1:
    m1 = 9
if n1 == 9:
    m1 = 1
if n2 == 1:
    m2 = 9
if n2 == 9:
    m2 = 1
if n3 == 1:
    m3 = 9
if n3 == 9:
    m3 = 1

print(m1*100 + m2*10 + m3)

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

b=[]
for i in range(3):
	if a[i]==1:
		b.append(str(9))
	else:
		b.append(str(1))

print(''.join(b))