l = list(map(int,input().split()))

xr = 0

for i in range(1,6):

  xr ^= i

for i in l:

  xr ^= i

print(xr)
l = list(map(int,input().split()))

xr = 0

for i in range(5):

  xr ^= (i+1)

  xr ^= l[i]

print(xr)

l = list(map(int, input().split()))
xr = 0
for i in range(1, 6):
    xr ^= i
for i in l:
    xr ^= i
print(xr)

l = list(map(int, input().split()))
xr = 0
for i in range(5):
    xr ^= i + 1
    xr ^= l[i]
print(xr)

-for i in range(1, 6): -    xr ^= i -for i in l: -    xr ^= i +for i in range(5): +    xr ^= i + 1 +    xr ^= l[i]