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

for i in range(10 ** 6 + 1):

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

        print(i)

        exit()

print("-1")
A, B = list(map(int, input().split()))

for ans in range(1, 1001):

    tmp_A = ans * 8 // 100

    tmp_B = ans // 10

    if tmp_A == A and tmp_B == B:

        print(ans)

        exit()

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

A, B = list(map(int, input().split()))
for ans in range(1, 1001):
    tmp_A = ans * 8 // 100
    tmp_B = ans // 10
    if tmp_A == A and tmp_B == B:
        print(ans)
        exit()
print("-1")

-for i in range(10**6 + 1): -    if i * 8 // 100 == A and i // 10 == B: -        print(i) +for ans in range(1, 1001): +    tmp_A = ans * 8 // 100 +    tmp_B = ans // 10 +    if tmp_A == A and tmp_B == B: +        print(ans)