x1, x2, x3, x4, x5 = list(map(int, input().split()))

if (x1 == 0):

    ans = 1

if (x2 == 0):

    ans = 2

if (x3 == 0):

    ans = 3

if (x4 == 0):

    ans = 4

if (x5 == 0):

    ans = 5

print((int(ans)))
x= list(map(int, input().split()))

sum = 0

for i in x:

    sum = sum + i

y = 15 - int(sum)

print((int(y)))
x1, x2, x3, x4, x5 = list(map(int, input().split()))
if x1 == 0:
    ans = 1
if x2 == 0:
    ans = 2
if x3 == 0:
    ans = 3
if x4 == 0:
    ans = 4
if x5 == 0:
    ans = 5
print((int(ans)))

x = list(map(int, input().split()))
sum = 0
for i in x:
    sum = sum + i
y = 15 - int(sum)
print((int(y)))

-x1, x2, x3, x4, x5 = list(map(int, input().split())) -if x1 == 0: -    ans = 1 -if x2 == 0: -    ans = 2 -if x3 == 0: -    ans = 3 -if x4 == 0: -    ans = 4 -if x5 == 0: -    ans = 5 -print((int(ans))) +x = list(map(int, input().split())) +sum = 0 +for i in x: +    sum = sum + i +y = 15 - int(sum) +print((int(y)))