ans = [ "9" if s == "1" else "1" for s in list(eval(input()))]

print(("".join(ans)))
print(("".join([ "9" if s == "1" else "1" for s in list(eval(input()))])))
ans = ["9" if s == "1" else "1" for s in list(eval(input()))]
print(("".join(ans)))

print(("".join(["9" if s == "1" else "1" for s in list(eval(input()))])))

-ans = ["9" if s == "1" else "1" for s in list(eval(input()))] -print(("".join(ans))) +print(("".join(["9" if s == "1" else "1" for s in list(eval(input()))])))