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



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


