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



ans = -1

for i in range(1, 10000):

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

    ans = i

    break

print(ans)
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)

    exit()

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

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)
        exit()
print((-1))

-ans = -1 -for i in range(1, 10000): +for i in range(1, 1001): -        ans = i -        break -print(ans) +        print(i) +        exit() +print((-1))