A, B = list(map(int, input().split()))



ans = -1

for i in range(1, 20001):

    a = int(i * 1.08) - i

    b = int(i * 1.1) - i

    if A == a and B == b:

        ans = i

        break

print(ans)

A, B= list(map(int, input().split()))



for i in range(1,1010):

    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()))
ans = -1
for i in range(1, 20001):
    a = int(i * 1.08) - i
    b = int(i * 1.1) - i
    if A == a and B == b:
        ans = i
        break
print(ans)

A, B = list(map(int, input().split()))
for i in range(1, 1010):
    if int(i * 0.08) == A and int(i * 0.1) == B:
        print(i)
        break
else:
    print("-1")

-ans = -1 -for i in range(1, 20001): -    a = int(i * 1.08) - i -    b = int(i * 1.1) - i -    if A == a and B == b: -        ans = i +for i in range(1, 1010): +    if int(i * 0.08) == A and int(i * 0.1) == B: +        print(i) -print(ans) +else: +    print("-1")