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

for n in range(1, 1001):

    a = int(n * 0.08)

    b = int(n * 0.1)

    if A == a and B == b:

        print(n)

        exit()

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

ans = -1

for x in range(13, 1250):

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

        ans = x

        break

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

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

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