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



for i in range(10000):

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

        print(i)

        exit(0)



else :

        print((-1))



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



for i in range(1001):

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

        print(i)

        break



else:print((-1))

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

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

-for i in range(10000): +for i in range(1001): -        exit(0) +        break