import itertools

import math

import fractions

import functools

import copy



n = input()

for i in range(len(n)):

    if n[i] == '1':

        print('9',end="")

    else:

        print('1',end="")

print("")

def main():

    # n = int(input())

    # h, w, k = map(int, input().split())

    # a = list(map(int, input().split()))

    s = eval(input())

    ans = ""

    for i in s:

        if i == "1":

            ans += "9"

        else:

            ans += "1"

    print(ans)





if __name__ == '__main__':

    main()

import itertools
import math
import fractions
import functools
import copy

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

def main():
    # n = int(input())
    # h, w, k = map(int, input().split())
    # a = list(map(int, input().split()))
    s = eval(input())
    ans = ""
    for i in s:
        if i == "1":
            ans += "9"
        else:
            ans += "1"
    print(ans)


if __name__ == "__main__":
    main()

-import itertools -import math -import fractions -import functools -import copy +def main(): +    # n = int(input()) +    # h, w, k = map(int, input().split()) +    # a = list(map(int, input().split())) +    s = eval(input()) +    ans = "" +    for i in s: +        if i == "1": +            ans += "9" +        else: +            ans += "1" +    print(ans) -n = input() -for i in range(len(n)): -    if n[i] == "1": -        print("9", end="") -    else: -        print("1", end="") -print("") + +if __name__ == "__main__": +    main()