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

for i in range(1,1001):

    a = int(i*0.08)

    b = int(i*0.1)

    if A==a and B==b:

        print(i)

        break

else:

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

for i in range(1,1001):

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

        print(i)

        break

else:

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

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

-    a = int(i * 0.08) -    b = int(i * 0.1) -    if A == a and B == b: +    if A == int(i * 0.08) and B == int(i * 0.1):