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

b = b/0.1

b_list = [i+b for i in range(10)]

for i in b_list:

    if int(i*0.08) == a:

        print((int(i)))

        exit()

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

for i in range(1,1009):

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

        print((int(i)))

        exit()

print("-1")
a, b = list(map(int, input().split()))
b = b / 0.1
b_list = [i + b for i in range(10)]
for i in b_list:
    if int(i * 0.08) == a:
        print((int(i)))
        exit()
print("-1")

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

-b = b / 0.1 -b_list = [i + b for i in range(10)] -for i in b_list: -    if int(i * 0.08) == a: +for i in range(1, 1009): +    if int(i * 0.08) == a and int(i * 0.1) == b: