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

for i in range(b*10, (b+1)*10):

    if int(i * 0.08) == a:

        print(i)

        break

else:

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

raw_b = b*10

for i in range(raw_b, raw_b+10):

    if int(i * 0.08) == a:

        print(i)

        break

else:

    print((-1))
a, b = list(map(int, input().split()))
for i in range(b * 10, (b + 1) * 10):
    if int(i * 0.08) == a:
        print(i)
        break
else:
    print((-1))

a, b = list(map(int, input().split()))
raw_b = b * 10
for i in range(raw_b, raw_b + 10):
    if int(i * 0.08) == a:
        print(i)
        break
else:
    print((-1))

-for i in range(b * 10, (b + 1) * 10): +raw_b = b * 10 +for i in range(raw_b, raw_b + 10):