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

ans =-1

for i in range(10000,-1,-1):

  money0 = int(i*0.08)

  money1= int(i*0.1)

  if money0==a and money1==b:

    ans = i

print(ans)

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

ans =-1

for i in range(1001,-1,-1):

  money0 = int(i*0.08)

  money1= int(i*0.1)

  if money0==a and money1==b:

    ans = i

print(ans)

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

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

-for i in range(10000, -1, -1): +for i in range(1001, -1, -1):