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



def floor(x, f):

    res = int(x / f)

    if int(res * f) < x:

        res += 1

    return res



ra = [floor(A, 0.08), floor(A + 1, 0.08)]

rb = [floor(B, 0.1), floor(B + 1, 0.1)]



if ra[1] <= rb[0] or rb[1] <= ra[0]:

    print((-1))

else:

    print((max(ra[0], rb[0])))



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





def floor_inv(x, f):

    res = int(x / f)

    if int(res * f) < x:

        res += 1

    return res





lb1 = floor_inv(A, 0.08)

ub1 = floor_inv(A + 1, 0.08)



lb2 = floor_inv(B, 0.10)

ub2 = floor_inv(B + 1, 0.10)



if ub1 <= lb2 or ub2 <= lb1:

    print((-1))

else:

    print((max(lb1, lb2)))

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


def floor(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res


ra = [floor(A, 0.08), floor(A + 1, 0.08)]
rb = [floor(B, 0.1), floor(B + 1, 0.1)]
if ra[1] <= rb[0] or rb[1] <= ra[0]:
    print((-1))
else:
    print((max(ra[0], rb[0])))

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


def floor_inv(x, f):
    res = int(x / f)
    if int(res * f) < x:
        res += 1
    return res


lb1 = floor_inv(A, 0.08)
ub1 = floor_inv(A + 1, 0.08)
lb2 = floor_inv(B, 0.10)
ub2 = floor_inv(B + 1, 0.10)
if ub1 <= lb2 or ub2 <= lb1:
    print((-1))
else:
    print((max(lb1, lb2)))

-def floor(x, f): +def floor_inv(x, f): -ra = [floor(A, 0.08), floor(A + 1, 0.08)] -rb = [floor(B, 0.1), floor(B + 1, 0.1)] -if ra[1] <= rb[0] or rb[1] <= ra[0]: +lb1 = floor_inv(A, 0.08) +ub1 = floor_inv(A + 1, 0.08) +lb2 = floor_inv(B, 0.10) +ub2 = floor_inv(B + 1, 0.10) +if ub1 <= lb2 or ub2 <= lb1: -    print((max(ra[0], rb[0]))) +    print((max(lb1, lb2)))