A,B,C,D,E,F = (int(x) for x in input().split())



CCT = {}

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

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

        water = (a*A+b*B)*100

        if water > F:

            continue

        max_suger = water*E//100

        for c in range(max_suger//C+1):

            for d in range(max_suger//D+1):

                suger = c*C+d*D

                total = water + suger

                if total > F or total == 0:

                    continue

                if max_suger < suger:

                    continue

                CCT[water,suger] = suger/total



ans = (A*100, 0)

max_cct = 0

for (water,suger),cct in list(CCT.items()):

    if cct > max_cct:

        max_cct = cct

        ans = (water+suger, suger)

print((*ans))

A,B,C,D,E,F = (int(x) for x in input().split())



CCT = {}

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

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

        water = (a*A+b*B)*100

        if water > F:

            continue

        max_suger = water*E//100

        for c in range(max_suger//C+1):

            for d in range((max_suger-c*C)//D+1):

                suger = c*C+d*D

                total = water + suger

                if total > F or total == 0 or max_suger < suger:

                    continue

                CCT[water,suger] = suger/total



ans = (A*100, 0)

max_cct = 0

for (water,suger),cct in list(CCT.items()):

    if cct > max_cct:

        max_cct = cct

        ans = (water+suger, suger)

print((*ans))

A, B, C, D, E, F = (int(x) for x in input().split())
CCT = {}
for a in range(F // (100 * A) + 1):
    for b in range(F // (100 * B) + 1):
        water = (a * A + b * B) * 100
        if water > F:
            continue
        max_suger = water * E // 100
        for c in range(max_suger // C + 1):
            for d in range(max_suger // D + 1):
                suger = c * C + d * D
                total = water + suger
                if total > F or total == 0:
                    continue
                if max_suger < suger:
                    continue
                CCT[water, suger] = suger / total
ans = (A * 100, 0)
max_cct = 0
for (water, suger), cct in list(CCT.items()):
    if cct > max_cct:
        max_cct = cct
        ans = (water + suger, suger)
print((*ans))

A, B, C, D, E, F = (int(x) for x in input().split())
CCT = {}
for a in range(F // (100 * A) + 1):
    for b in range(F // (100 * B) + 1):
        water = (a * A + b * B) * 100
        if water > F:
            continue
        max_suger = water * E // 100
        for c in range(max_suger // C + 1):
            for d in range((max_suger - c * C) // D + 1):
                suger = c * C + d * D
                total = water + suger
                if total > F or total == 0 or max_suger < suger:
                    continue
                CCT[water, suger] = suger / total
ans = (A * 100, 0)
max_cct = 0
for (water, suger), cct in list(CCT.items()):
    if cct > max_cct:
        max_cct = cct
        ans = (water + suger, suger)
print((*ans))

-            for d in range(max_suger // D + 1): +            for d in range((max_suger - c * C) // D + 1): -                if total > F or total == 0: -                    continue -                if max_suger < suger: +                if total > F or total == 0 or max_suger < suger: