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

for i in range(10,1250):

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

    print(i)

    break

else:

  print((-1))

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

for i in range(B*10,(B+1)*10):

  if int(i*0.08)==A:

    print(i)

    break

else:

  print((-1))

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

A, B = list(map(int, input().split()))
for i in range(B * 10, (B + 1) * 10):
    if int(i * 0.08) == A:
        print(i)
        break
else:
    print((-1))

-for i in range(10, 1250): -    if int(i * 0.08) == A and int(i * 0.1) == B: +for i in range(B * 10, (B + 1) * 10): +    if int(i * 0.08) == A: