from functools import reduce

n=int(eval(input()))

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

for i in range(0,len(s)):

    if s[i]==1:

        s[i]=9

    else:

        s[i]=1

print((int(reduce(lambda x, y: x + y, [str(x) for x in s]))))
n=list(eval(input()))

p=""

for i in range(len(n)):

    n[i]=10-int(n[i])

    p+=str(n[i])

print(p)
from functools import reduce

n = int(eval(input()))
s = [int(x) for x in list(str(n))]
for i in range(0, len(s)):
    if s[i] == 1:
        s[i] = 9
    else:
        s[i] = 1
print((int(reduce(lambda x, y: x + y, [str(x) for x in s]))))

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

-from functools import reduce - -n = int(eval(input())) -s = [int(x) for x in list(str(n))] -for i in range(0, len(s)): -    if s[i] == 1: -        s[i] = 9 -    else: -        s[i] = 1 -print((int(reduce(lambda x, y: x + y, [str(x) for x in s])))) +n = list(eval(input())) +p = "" +for i in range(len(n)): +    n[i] = 10 - int(n[i]) +    p += str(n[i]) +print(p)