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

ans = [100 * A, 0]

c = 0



for i in range(1, F // (100 * A) + 1):

    for j in range((F - 100 * A * i) // (100 * B) + 1):

        a = 100 * A * i + 100 * B * j

        for k in range((F - a) // C + 1):

            for l in range((F - a - C * k) // D + 1):

                b = k * C + l * D

                concentration = 100 * b / (a + b)

                if (A * i + B * j) * E >= b:

                    if concentration > c:

                        c = concentration

                        ans = [a + b, b]

                else:

                    break



print((' '.join(map(str, ans))))
A, B, C, D, E, F = list(map(int, input().split()))

water = set([])



for i in range(1, F // (100 * A) + 1):

    water1 = i * 100 * A

    for j in range((F - water1) // (100 * B) + 1):

        water2 = j * 100 * B

        water.add(water1 + water2)



ans = [100 * A, 0]

c = 0



for i in water:

    max_sugar = min(i // 100 * E, F - i)

    sugar = [0]

    for j in range(max_sugar // C + 1):

        for k in range((max_sugar - j * C) // D + 1):

            sugar.append(j * C + k * D)

    max_sugar = max(sugar)

    concentration = max_sugar / (i + max_sugar)

    if c < concentration:

        c = concentration

        ans = [i + max_sugar, max_sugar]



print((' '.join(map(str, ans))))
A, B, C, D, E, F = list(map(int, input().split()))
ans = [100 * A, 0]
c = 0
for i in range(1, F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        a = 100 * A * i + 100 * B * j
        for k in range((F - a) // C + 1):
            for l in range((F - a - C * k) // D + 1):
                b = k * C + l * D
                concentration = 100 * b / (a + b)
                if (A * i + B * j) * E >= b:
                    if concentration > c:
                        c = concentration
                        ans = [a + b, b]
                else:
                    break
print((" ".join(map(str, ans))))

A, B, C, D, E, F = list(map(int, input().split()))
water = set([])
for i in range(1, F // (100 * A) + 1):
    water1 = i * 100 * A
    for j in range((F - water1) // (100 * B) + 1):
        water2 = j * 100 * B
        water.add(water1 + water2)
ans = [100 * A, 0]
c = 0
for i in water:
    max_sugar = min(i // 100 * E, F - i)
    sugar = [0]
    for j in range(max_sugar // C + 1):
        for k in range((max_sugar - j * C) // D + 1):
            sugar.append(j * C + k * D)
    max_sugar = max(sugar)
    concentration = max_sugar / (i + max_sugar)
    if c < concentration:
        c = concentration
        ans = [i + max_sugar, max_sugar]
print((" ".join(map(str, ans))))

+water = set([]) +for i in range(1, F // (100 * A) + 1): +    water1 = i * 100 * A +    for j in range((F - water1) // (100 * B) + 1): +        water2 = j * 100 * B +        water.add(water1 + water2) -for i in range(1, F // (100 * A) + 1): -    for j in range((F - 100 * A * i) // (100 * B) + 1): -        a = 100 * A * i + 100 * B * j -        for k in range((F - a) // C + 1): -            for l in range((F - a - C * k) // D + 1): -                b = k * C + l * D -                concentration = 100 * b / (a + b) -                if (A * i + B * j) * E >= b: -                    if concentration > c: -                        c = concentration -                        ans = [a + b, b] -                else: -                    break +for i in water: +    max_sugar = min(i // 100 * E, F - i) +    sugar = [0] +    for j in range(max_sugar // C + 1): +        for k in range((max_sugar - j * C) // D + 1): +            sugar.append(j * C + k * D) +    max_sugar = max(sugar) +    concentration = max_sugar / (i + max_sugar) +    if c < concentration: +        c = concentration +        ans = [i + max_sugar, max_sugar]