n = list(input())

for i in n:

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

    else:print('1',end='')

n = eval(input())

ans = ''

for i in n:

    if i == '9': ans += '1'

    else: ans += '9'

print(ans)

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

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

-n = list(input()) +n = eval(input()) +ans = "" -    if i == "1": -        print("9", end="") +    if i == "9": +        ans += "1" -        print("1", end="") +        ans += "9" +print(ans)