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





ans = -1

for x in range(100000):

    a = int(x * 0.08)

    b = int(x * 0.1)

    if a == A and b == B:

        ans = x

        break



print(ans)

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

for x in range(10000):

    a = int(x * 0.08)

    b = int(x * 0.1)

    if a == A and b == B:

        print(x)

        exit()

print((-1))
A, B = list(map(int, input().split()))
ans = -1
for x in range(100000):
    a = int(x * 0.08)
    b = int(x * 0.1)
    if a == A and b == B:
        ans = x
        break
print(ans)

A, B = list(map(int, input().split()))
for x in range(10000):
    a = int(x * 0.08)
    b = int(x * 0.1)
    if a == A and b == B:
        print(x)
        exit()
print((-1))

-ans = -1 -for x in range(100000): +for x in range(10000): -        ans = x -        break -print(ans) +        print(x) +        exit() +print((-1))