# C - Tax Increase

# https://atcoder.jp/contests/abc158/tasks/abc158_c



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



for x in range(1, 100000):

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

    print(x)

    exit()



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



for i in range(10001):

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

    print(i)

    exit()

    

print((-1))
# C - Tax Increase
# https://atcoder.jp/contests/abc158/tasks/abc158_c
a, b = list(map(int, input().split()))
for x in range(1, 100000):
    if int(x * 0.08) == a and int(x * 0.1) == b:
        print(x)
        exit()
print((-1))

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

-# C - Tax Increase -# https://atcoder.jp/contests/abc158/tasks/abc158_c -for x in range(1, 100000): -    if int(x * 0.08) == a and int(x * 0.1) == b: -        print(x) +for i in range(10001): +    if int(i * 0.08) == a and int(i * 0.1) == b: +        print(i)