A=int(eval(input()))

B=int(eval(input()))

if A!=1 and B!=1:

    print("1")

if A!=2 and B!=2:

    print("2")

if A!=3 and B!=3:

    print("3")
A=int(eval(input()))

B=int(eval(input()))

for x in range(1,4):

    if A!=x and B!=x:

        print(x)
A = int(eval(input()))
B = int(eval(input()))
if A != 1 and B != 1:
    print("1")
if A != 2 and B != 2:
    print("2")
if A != 3 and B != 3:
    print("3")

A = int(eval(input()))
B = int(eval(input()))
for x in range(1, 4):
    if A != x and B != x:
        print(x)

-if A != 1 and B != 1: -    print("1") -if A != 2 and B != 2: -    print("2") -if A != 3 and B != 3: -    print("3") +for x in range(1, 4): +    if A != x and B != x: +        print(x)