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

c = []

ans_list = []



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

    for j in range(F // (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) // D + 1):

                b = k * C + l * D

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

                    c.append(100 * b / (a + b))

                    ans_list.append([a + b, b])

                else:

                    break



ans = ans_list[c.index(max(c))]



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 * 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) // 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()))
c = []
ans_list = []
for i in range(1, F // (100 * A) + 1):
    for j in range(F // (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) // D + 1):
                b = k * C + l * D
                if (A * i + B * j) * E >= b and a + b <= F:
                    c.append(100 * b / (a + b))
                    ans_list.append([a + b, b])
                else:
                    break
ans = ans_list[c.index(max(c))]
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 * 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) // 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))))

-c = [] -ans_list = [] +ans = [100 * A, 0] +c = 0 +                concentration = 100 * b / (a + b) -                    c.append(100 * b / (a + b)) -                    ans_list.append([a + b, b]) +                    if concentration > c: +                        c = concentration +                        ans = [a + b, b] -ans = ans_list[c.index(max(c))]