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

        if a > F:

            break

        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 and a + b <= F:

                    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()))

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()))
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
        if a > F:
            break
        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 and a + b <= F:
                    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()))
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))))

-        if a > F: -            break -                if (A * i + B * j) * E >= b and a + b <= F: +                if (A * i + B * j) * E >= b: