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

for i in range(10**6):

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

        print(i)

        exit()

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

for i in range(10**6):

    if i*8//100==a and i//10==b:

        print(i)

        exit()

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

a, b = list(map(int, input().split()))
for i in range(10**6):
    if i * 8 // 100 == a and i // 10 == b:
        print(i)
        exit()
print((-1))

-    if int(i * 0.08) == a and int(i * 0.1) == b: +    if i * 8 // 100 == a and i // 10 == b: