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

for i in range(b*10,b*10+9):

    if int(i*0.08)==a:

        print(i)

        break

else:

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

for i in range(1,1001):

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

        print(i)

        break

else:

    print((-1))
a, b = list(map(int, input().split()))
for i in range(b * 10, b * 10 + 9):
    if int(i * 0.08) == a:
        print(i)
        break
else:
    print((-1))

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

-for i in range(b * 10, b * 10 + 9): -    if int(i * 0.08) == a: +for i in range(1, 1001): +    if int(i * 0.08) == a and int(i * 0.1) == b: