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



n=1

while n<=10**6:

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

    print(n)

    exit()

  else:

    n+=1

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



n=1

while n<=2*10**4:

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

    print(n)

    exit()

  else:

    n+=1

print((-1))
a, b = list(map(int, input().split()))
n = 1
while n <= 10**6:
    if int(n * 0.08) == a and int(n * 0.1) == b:
        print(n)
        exit()
    else:
        n += 1
print((-1))

a, b = list(map(int, input().split()))
n = 1
while n <= 2 * 10**4:
    if int(n * 0.08) == a and int(n * 0.1) == b:
        print(n)
        exit()
    else:
        n += 1
print((-1))

-while n <= 10**6: +while n <= 2 * 10**4: