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

for i in range(20000):

    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(2000):

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

    print(i)

    break

else:

    print((-1))

A, B = list(map(int, input().split()))
for i in range(20000):
    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(2000):
    if A == i * 8 // 100 and B == i * 10 // 100:
        print(i)
        break
else:
    print((-1))

-for i in range(20000): -    if int(i * 0.08) == A and int(i * 0.1) == B: +for i in range(2000): +    if A == i * 8 // 100 and B == i * 10 // 100: -        exit() -print((-1)) +        break +else: +    print((-1))