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

c = -1

for i in range(20000):

    if int(i*0.08) == a and int(i*0.1) == b :

        c = i

        break

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

c = -1

for i in range(10000):

    if int(i*0.08) == a and int(i*0.1) == b :

        c = i

        break

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

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

-for i in range(20000): +for i in range(10000):