A,B,C,D,E,F = list(map(int,input().split()))



water_sugar = []

sugar_best = []



for a in range(0,31):

    water = A*a

    sugar = E*water

    if water==0:

        pass

    elif (water*100)>F:

        break

    elif (water*100)+sugar>F:

        water_sugar.append([water*100,F-(water*100)])

    elif (water*100)+sugar<=F:

        water_sugar.append([water*100,sugar])

    for b in range(1,31):

        water += B

        sugar = E*water

        if (water*100)>F:

            break

        elif (water*100)+sugar>F:

            water_sugar.append([water*100,F-(water*100)])

        elif (water*100)+sugar<=F:

            water_sugar.append([water*100,sugar])



#print(water_sugar)



for ws in water_sugar:

    sugar = []

    c=0

    while(True):

        s = c*C

        if s<=ws[1]:

            sugar.append(s)

        else:

            break

        while(True):

            s += D

            if s<=ws[1]:

                sugar.append(s)

            else:

                break

        c+=1

    ws[1] = max(sugar)

    sugar_best.append((100*ws[1])/(ws[0]+ws[1]))

    

best = water_sugar[sugar_best.index(max(sugar_best))]



print((best[0]+best[1],best[1]))
A,B,C,D,E,F = list(map(int,input().split()))



water_sugar = []

sugar_best = []

s = 0

max_sugar = 0



for a in range(0,31):

    water = A*a

    sugar = E*water

    if water==0:

        pass

    elif (water*100)>F:

        break

    elif (water*100)+sugar>F:

        s = F-(water*100)

        water_sugar.append([water*100,s])

    elif (water*100)+sugar<=F:

        s = sugar

        water_sugar.append([water*100,s])

    if s>max_sugar: max_sugar=s

    for b in range(1,31):

        water += B

        sugar = E*water

        if (water*100)>F:

            break

        elif (water*100)+sugar>F:

            s = F-(water*100)

            water_sugar.append([water*100,s])

        elif (water*100)+sugar<=F:

            s = sugar

            water_sugar.append([water*100,s])

        if s>max_sugar: max_sugar=s

        



#print(water_sugar)

#print(max_sugar)



sugar = []

c=0

while(True):

    s = c*C

    if s<=max_sugar:

        sugar.append(s)

    else:

        break

    while(True):

        s += D

        if s<=max_sugar:

            sugar.append(s)

        else:

            break

    c+=1

sugar = sorted(sugar,reverse=True)



#print(sugar)



for ws in water_sugar:

    for s in sugar:

        if s<=ws[1]: break

    ws[1] = s

    sugar_best.append((100*ws[1])/(ws[0]+ws[1]))

    

best = water_sugar[sugar_best.index(max(sugar_best))]



print((best[0]+best[1],best[1]))
A, B, C, D, E, F = list(map(int, input().split()))
water_sugar = []
sugar_best = []
for a in range(0, 31):
    water = A * a
    sugar = E * water
    if water == 0:
        pass
    elif (water * 100) > F:
        break
    elif (water * 100) + sugar > F:
        water_sugar.append([water * 100, F - (water * 100)])
    elif (water * 100) + sugar <= F:
        water_sugar.append([water * 100, sugar])
    for b in range(1, 31):
        water += B
        sugar = E * water
        if (water * 100) > F:
            break
        elif (water * 100) + sugar > F:
            water_sugar.append([water * 100, F - (water * 100)])
        elif (water * 100) + sugar <= F:
            water_sugar.append([water * 100, sugar])
# print(water_sugar)
for ws in water_sugar:
    sugar = []
    c = 0
    while True:
        s = c * C
        if s <= ws[1]:
            sugar.append(s)
        else:
            break
        while True:
            s += D
            if s <= ws[1]:
                sugar.append(s)
            else:
                break
        c += 1
    ws[1] = max(sugar)
    sugar_best.append((100 * ws[1]) / (ws[0] + ws[1]))
best = water_sugar[sugar_best.index(max(sugar_best))]
print((best[0] + best[1], best[1]))

A, B, C, D, E, F = list(map(int, input().split()))
water_sugar = []
sugar_best = []
s = 0
max_sugar = 0
for a in range(0, 31):
    water = A * a
    sugar = E * water
    if water == 0:
        pass
    elif (water * 100) > F:
        break
    elif (water * 100) + sugar > F:
        s = F - (water * 100)
        water_sugar.append([water * 100, s])
    elif (water * 100) + sugar <= F:
        s = sugar
        water_sugar.append([water * 100, s])
    if s > max_sugar:
        max_sugar = s
    for b in range(1, 31):
        water += B
        sugar = E * water
        if (water * 100) > F:
            break
        elif (water * 100) + sugar > F:
            s = F - (water * 100)
            water_sugar.append([water * 100, s])
        elif (water * 100) + sugar <= F:
            s = sugar
            water_sugar.append([water * 100, s])
        if s > max_sugar:
            max_sugar = s
# print(water_sugar)
# print(max_sugar)
sugar = []
c = 0
while True:
    s = c * C
    if s <= max_sugar:
        sugar.append(s)
    else:
        break
    while True:
        s += D
        if s <= max_sugar:
            sugar.append(s)
        else:
            break
    c += 1
sugar = sorted(sugar, reverse=True)
# print(sugar)
for ws in water_sugar:
    for s in sugar:
        if s <= ws[1]:
            break
    ws[1] = s
    sugar_best.append((100 * ws[1]) / (ws[0] + ws[1]))
best = water_sugar[sugar_best.index(max(sugar_best))]
print((best[0] + best[1], best[1]))

+s = 0 +max_sugar = 0 -        water_sugar.append([water * 100, F - (water * 100)]) +        s = F - (water * 100) +        water_sugar.append([water * 100, s]) -        water_sugar.append([water * 100, sugar]) +        s = sugar +        water_sugar.append([water * 100, s]) +    if s > max_sugar: +        max_sugar = s -            water_sugar.append([water * 100, F - (water * 100)]) +            s = F - (water * 100) +            water_sugar.append([water * 100, s]) -            water_sugar.append([water * 100, sugar]) +            s = sugar +            water_sugar.append([water * 100, s]) +        if s > max_sugar: +            max_sugar = s -for ws in water_sugar: -    sugar = [] -    c = 0 +# print(max_sugar) +sugar = [] +c = 0 +while True: +    s = c * C +    if s <= max_sugar: +        sugar.append(s) +    else: +        break -        s = c * C -        if s <= ws[1]: +        s += D +        if s <= max_sugar: -        while True: -            s += D -            if s <= ws[1]: -                sugar.append(s) -            else: -                break -        c += 1 -    ws[1] = max(sugar) +    c += 1 +sugar = sorted(sugar, reverse=True) +# print(sugar) +for ws in water_sugar: +    for s in sugar: +        if s <= ws[1]: +            break +    ws[1] = s