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



for i in range(100000):

    if int(i*0.08) == A and int(i*0.1) == B:

        break

print((i if i != 99999 else -1))

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

for i in range(10000):

    if int(i*0.08) == A and int(i*0.1) == B:

        print(i)

        exit()

print((-1))

A, B = list(map(int, input().split()))
for i in range(100000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        break
print((i if i != 99999 else -1))

A, B = list(map(int, input().split()))
for i in range(10000):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        exit()
print((-1))

-for i in range(100000): +for i in range(10000): -        break -print((i if i != 99999 else -1)) +        print(i) +        exit() +print((-1))