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

ans = -1

for x in range(10001):

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

        ans = x

        break



print(ans)

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

ans = -1

for x in range(1010):

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

        ans = x

        break



print(ans)

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

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

-for x in range(10001): +for x in range(1010):