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



w = []

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

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

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

        if a < F:

            w.append(a)



best_concentration = -1

best_a = -1

best_b = -1

for a in w:

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

        for j in range((F - a) // D + 1):

            b = C * i + D * j

            if a + b > F:

                continue

            if b > E * a // 100:

                continue

            if a + b == 0:

                continue

            concentration = 100 * b / (a + b)

            if concentration > best_concentration:

                best_concentration = concentration

                best_a = a

                best_b = b

print((best_a + best_b, best_b))

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



w = set()

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

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

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

        if a < F:

            w.add(a)

w.remove(0)



best_concentration = -1

best_a = -1

best_b = -1

for a in w:

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

        for j in range((F - a) // D + 1):

            b = C * i + D * j

            if a + b > F:

                continue

            if b > E * a // 100:

                continue

            concentration = 100 * b / (a + b)

            if concentration > best_concentration:

                best_concentration = concentration

                best_a = a

                best_b = b

print((best_a + best_b, best_b))

A, B, C, D, E, F = list(map(int, input().split()))
w = []
for i in range(F // (100 * A) + 1):
    for j in range(F // (100 * B) + 1):
        a = (A * i + B * j) * 100
        if a < F:
            w.append(a)
best_concentration = -1
best_a = -1
best_b = -1
for a in w:
    for i in range((F - a) // C + 1):
        for j in range((F - a) // D + 1):
            b = C * i + D * j
            if a + b > F:
                continue
            if b > E * a // 100:
                continue
            if a + b == 0:
                continue
            concentration = 100 * b / (a + b)
            if concentration > best_concentration:
                best_concentration = concentration
                best_a = a
                best_b = b
print((best_a + best_b, best_b))

A, B, C, D, E, F = list(map(int, input().split()))
w = set()
for i in range(F // (100 * A) + 1):
    for j in range(F // (100 * B) + 1):
        a = (A * i + B * j) * 100
        if a < F:
            w.add(a)
w.remove(0)
best_concentration = -1
best_a = -1
best_b = -1
for a in w:
    for i in range((F - a) // C + 1):
        for j in range((F - a) // D + 1):
            b = C * i + D * j
            if a + b > F:
                continue
            if b > E * a // 100:
                continue
            concentration = 100 * b / (a + b)
            if concentration > best_concentration:
                best_concentration = concentration
                best_a = a
                best_b = b
print((best_a + best_b, best_b))

-w = [] +w = set() -            w.append(a) +            w.add(a) +w.remove(0) -            if a + b == 0: -                continue