isFound = False

li = list(map(int,input().split()))

min = int(li[0] / 0.08)

max = int((li[0] + 1) / 0.08) - 1

for i in range(min, max):

    if((int(i * 0.1) == li[1]) and (int(i * 0.08) == li[0])):

        print(i)

        isFound = True

        break

if(not(isFound)):

    print((-1))
import math

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

minV = math.ceil(A / 0.08)

maxV = int((A + 1) / 0.08)

for i in range(minV, maxV):

    if int(i * 0.1) == B:

        print(i)

        exit()

print((-1))
isFound = False
li = list(map(int, input().split()))
min = int(li[0] / 0.08)
max = int((li[0] + 1) / 0.08) - 1
for i in range(min, max):
    if (int(i * 0.1) == li[1]) and (int(i * 0.08) == li[0]):
        print(i)
        isFound = True
        break
if not (isFound):
    print((-1))

import math

A, B = list(map(int, input().split()))
minV = math.ceil(A / 0.08)
maxV = int((A + 1) / 0.08)
for i in range(minV, maxV):
    if int(i * 0.1) == B:
        print(i)
        exit()
print((-1))

-isFound = False -li = list(map(int, input().split())) -min = int(li[0] / 0.08) -max = int((li[0] + 1) / 0.08) - 1 -for i in range(min, max): -    if (int(i * 0.1) == li[1]) and (int(i * 0.08) == li[0]): +import math + +A, B = list(map(int, input().split())) +minV = math.ceil(A / 0.08) +maxV = int((A + 1) / 0.08) +for i in range(minV, maxV): +    if int(i * 0.1) == B: -        isFound = True -        break -if not (isFound): -    print((-1)) +        exit() +print((-1))