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

for i in range(10101):

    if i * 8 // 100 == A and i * 10 // 100 == B:

        print(i)

        exit()

print((-1))

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

for i in range(1011):

    if i * 8 // 100 == A and i * 10 // 100 == B:

        print(i)

        exit()

print((-1))

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

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

-for i in range(10101): +for i in range(1011):