A, B = list(map(int, input().split(' ')))

rst = -1

for i in range(1, 100000):

    if i * 8 // 100 == A and i * 10 // 100 == B:

        rst = i

        break

print(rst)
A, B = list(map(int, input().split(' ')))

for i in range(1, 1500):

    if i * 8 // 100 == A and i * 10 // 100 == B:

        print(i)

        break

else:

    print((-1))
A, B = list(map(int, input().split(" ")))
rst = -1
for i in range(1, 100000):
    if i * 8 // 100 == A and i * 10 // 100 == B:
        rst = i
        break
print(rst)

A, B = list(map(int, input().split(" ")))
for i in range(1, 1500):
    if i * 8 // 100 == A and i * 10 // 100 == B:
        print(i)
        break
else:
    print((-1))

-rst = -1 -for i in range(1, 100000): +for i in range(1, 1500): -        rst = i +        print(i) -print(rst) +else: +    print((-1))