a,b = list(map(int,input().split()))

v = 1

while True:

    if (v*0.08)//1 == a and (v*0.1)//1 == b:

        ans = v

        break

    v += 1

    if v > 10100:

        ans = -1

        break

print(ans)

a,b = list(map(int,input().split()))

v = 1

for v in range(1,1010):

    if (v*0.08)//1 == a and (v*0.1)//1 == b:

        ans = v

        break

else:

    ans = -1

print(ans)
a, b = list(map(int, input().split()))
v = 1
while True:
    if (v * 0.08) // 1 == a and (v * 0.1) // 1 == b:
        ans = v
        break
    v += 1
    if v > 10100:
        ans = -1
        break
print(ans)

a, b = list(map(int, input().split()))
v = 1
for v in range(1, 1010):
    if (v * 0.08) // 1 == a and (v * 0.1) // 1 == b:
        ans = v
        break
else:
    ans = -1
print(ans)

-while True: +for v in range(1, 1010): -    v += 1 -    if v > 10100: -        ans = -1 -        break +else: +    ans = -1