a, b, c, d, e, f = list(map(int, input().split()))

water = []

for i in range(31):

    for j in range(31):

        if (a*i+b*j)*100<=f:

            water.append(a*i+b*j)

water = list(set(water))



result = [[0,a*100,0]]

for i in water:

    for x in range(301):

        for y in range(301):

            if i > 0 and c*x+d*y > 0 and c*x+d*y<=i*e and (c*x+d*y+100*i)<=f:

                result.append([100*(c*x+d*y)/(c*x+d*y+100*i), c*x+d*y+100*i, c*x+d*y])



result.sort(reverse=True)

print((result[0][1], result[0][2]))
a, b, c, d, e, f = list(map(int, input().split()))

water = []

for i in range(31):

    for j in range(31):

        if a*i+b*j <= f//100:

            water.append(a*i+b*j)

water.pop(water.index(0))

water = list(set(water))

result = [[0,0,0]]

for w in water:

    for i in range(301):

        for j in range(301):

            sugar = c*i+d*j

            if sugar <= w*e and sugar+w*100 <= f: 

                result.append([100*sugar/(sugar+w*100), (sugar+w*100), sugar])

result.sort(reverse=True)

print((result[0][1], result[0][2]))
a, b, c, d, e, f = list(map(int, input().split()))
water = []
for i in range(31):
    for j in range(31):
        if (a * i + b * j) * 100 <= f:
            water.append(a * i + b * j)
water = list(set(water))
result = [[0, a * 100, 0]]
for i in water:
    for x in range(301):
        for y in range(301):
            if (
                i > 0
                and c * x + d * y > 0
                and c * x + d * y <= i * e
                and (c * x + d * y + 100 * i) <= f
            ):
                result.append(
                    [
                        100 * (c * x + d * y) / (c * x + d * y + 100 * i),
                        c * x + d * y + 100 * i,
                        c * x + d * y,
                    ]
                )
result.sort(reverse=True)
print((result[0][1], result[0][2]))

a, b, c, d, e, f = list(map(int, input().split()))
water = []
for i in range(31):
    for j in range(31):
        if a * i + b * j <= f // 100:
            water.append(a * i + b * j)
water.pop(water.index(0))
water = list(set(water))
result = [[0, 0, 0]]
for w in water:
    for i in range(301):
        for j in range(301):
            sugar = c * i + d * j
            if sugar <= w * e and sugar + w * 100 <= f:
                result.append(
                    [100 * sugar / (sugar + w * 100), (sugar + w * 100), sugar]
                )
result.sort(reverse=True)
print((result[0][1], result[0][2]))

-        if (a * i + b * j) * 100 <= f: +        if a * i + b * j <= f // 100: +water.pop(water.index(0)) -result = [[0, a * 100, 0]] -for i in water: -    for x in range(301): -        for y in range(301): -            if ( -                i > 0 -                and c * x + d * y > 0 -                and c * x + d * y <= i * e -                and (c * x + d * y + 100 * i) <= f -            ): +result = [[0, 0, 0]] +for w in water: +    for i in range(301): +        for j in range(301): +            sugar = c * i + d * j +            if sugar <= w * e and sugar + w * 100 <= f: -                    [ -                        100 * (c * x + d * y) / (c * x + d * y + 100 * i), -                        c * x + d * y + 100 * i, -                        c * x + d * y, -                    ] +                    [100 * sugar / (sugar + w * 100), (sugar + w * 100), sugar]