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





ans = None

for i in range(100000):

    a = int(i * 0.08)

    b = int(i * 0.1)

    if a == A and b == B:

        ans = i

        break



if ans is None:

    print((-1))

else:

    print(ans)

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



ans = -1

for yen in range(10000):

    a = int(yen * (8/100))

    b = int(yen * (10/100))

    if A == a and B == b:

        ans = yen

        break



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

A, B = list(map(int, input().split()))
ans = -1
for yen in range(10000):
    a = int(yen * (8 / 100))
    b = int(yen * (10 / 100))
    if A == a and B == b:
        ans = yen
        break
print(ans)

-ans = None -for i in range(100000): -    a = int(i * 0.08) -    b = int(i * 0.1) -    if a == A and b == B: -        ans = i +ans = -1 +for yen in range(10000): +    a = int(yen * (8 / 100)) +    b = int(yen * (10 / 100)) +    if A == a and B == b: +        ans = yen -if ans is None: -    print((-1)) -else: -    print(ans) +print(ans)