A = int(eval(input()))

B = int(eval(input()))



ans = [1, 2, 3]

wrong = [A, B]



for i in ans:

    if i not in wrong:

        print(i)

ans = set([1, 2, 3])

A = int(eval(input()))

B = int(eval(input()))



ans.remove(A)

ans.remove(B)



print((*ans))

A = int(eval(input()))
B = int(eval(input()))
ans = [1, 2, 3]
wrong = [A, B]
for i in ans:
    if i not in wrong:
        print(i)

ans = set([1, 2, 3])
A = int(eval(input()))
B = int(eval(input()))
ans.remove(A)
ans.remove(B)
print((*ans))

+ans = set([1, 2, 3]) -ans = [1, 2, 3] -wrong = [A, B] -for i in ans: -    if i not in wrong: -        print(i) +ans.remove(A) +ans.remove(B) +print((*ans))