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

water = []

for i in range(31):

    if A*i >= F:

        break

    for j in range(16):

        if 100 * (A*i + B*j) < F:

            water.append(100*(A*i+B*j))

        else:

            break

water = sorted(list(set(water)))



sugar = []

for i in range(max(water)//100*E//C + 1):

    for j in range(max(water)//100*E//D + 1):

        temp_sugar = C*i + D*j

        if temp_sugar + water[1] <= F:

            sugar.append(temp_sugar)

        else:

            break

sugar = sorted(list(set(sugar)))



max_conc = 0

ans_W = 100*A

ans_sugar = 0

for W in water:

    if W == 0:

        continue

    for S in sugar:

        if S+W <= F and S <= W*E//100:

            if max_conc < S/(W+S):

                max_conc = S/(S+W)

                ans_W = W

                ans_sugar = S

        else:

            break

print(('{0} {1}'.format(ans_W+ans_sugar, ans_sugar)))

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



max_sugar = 0

max_water = 100*A

max_conc = 0.0

A_limit = F // (100*A)

for i in range(A_limit + 1):

    B_limit = (F-100*A*i) // (100*B)

    for j in range(B_limit + 1):

        if i == 0 and j == 0:

            continue

        sugar_limit = min(E * (A*i+B*j), F-100*(A*i+B*j))



        sugar_ = 0

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

            d = (sugar_limit-c*C)//D

            temp_sugar = c*C + d*D

            sugar_ = max(sugar_, temp_sugar)

        temp_conc = sugar_/(sugar_+100*(A*i+B*j))

        if temp_conc > max_conc:

            max_conc = temp_conc

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

            max_sugar = sugar_

print(('{0} {1}'.format(max_water+max_sugar, max_sugar)))

A, B, C, D, E, F = list(map(int, input().split(" ")))
water = []
for i in range(31):
    if A * i >= F:
        break
    for j in range(16):
        if 100 * (A * i + B * j) < F:
            water.append(100 * (A * i + B * j))
        else:
            break
water = sorted(list(set(water)))
sugar = []
for i in range(max(water) // 100 * E // C + 1):
    for j in range(max(water) // 100 * E // D + 1):
        temp_sugar = C * i + D * j
        if temp_sugar + water[1] <= F:
            sugar.append(temp_sugar)
        else:
            break
sugar = sorted(list(set(sugar)))
max_conc = 0
ans_W = 100 * A
ans_sugar = 0
for W in water:
    if W == 0:
        continue
    for S in sugar:
        if S + W <= F and S <= W * E // 100:
            if max_conc < S / (W + S):
                max_conc = S / (S + W)
                ans_W = W
                ans_sugar = S
        else:
            break
print(("{0} {1}".format(ans_W + ans_sugar, ans_sugar)))

A, B, C, D, E, F = list(map(int, input().split(" ")))
max_sugar = 0
max_water = 100 * A
max_conc = 0.0
A_limit = F // (100 * A)
for i in range(A_limit + 1):
    B_limit = (F - 100 * A * i) // (100 * B)
    for j in range(B_limit + 1):
        if i == 0 and j == 0:
            continue
        sugar_limit = min(E * (A * i + B * j), F - 100 * (A * i + B * j))
        sugar_ = 0
        for c in range(sugar_limit // C + 1):
            d = (sugar_limit - c * C) // D
            temp_sugar = c * C + d * D
            sugar_ = max(sugar_, temp_sugar)
        temp_conc = sugar_ / (sugar_ + 100 * (A * i + B * j))
        if temp_conc > max_conc:
            max_conc = temp_conc
            max_water = 100 * (A * i + B * j)
            max_sugar = sugar_
print(("{0} {1}".format(max_water + max_sugar, max_sugar)))

-water = [] -for i in range(31): -    if A * i >= F: -        break -    for j in range(16): -        if 100 * (A * i + B * j) < F: -            water.append(100 * (A * i + B * j)) -        else: -            break -water = sorted(list(set(water))) -sugar = [] -for i in range(max(water) // 100 * E // C + 1): -    for j in range(max(water) // 100 * E // D + 1): -        temp_sugar = C * i + D * j -        if temp_sugar + water[1] <= F: -            sugar.append(temp_sugar) -        else: -            break -sugar = sorted(list(set(sugar))) -max_conc = 0 -ans_W = 100 * A -ans_sugar = 0 -for W in water: -    if W == 0: -        continue -    for S in sugar: -        if S + W <= F and S <= W * E // 100: -            if max_conc < S / (W + S): -                max_conc = S / (S + W) -                ans_W = W -                ans_sugar = S -        else: -            break -print(("{0} {1}".format(ans_W + ans_sugar, ans_sugar))) +max_sugar = 0 +max_water = 100 * A +max_conc = 0.0 +A_limit = F // (100 * A) +for i in range(A_limit + 1): +    B_limit = (F - 100 * A * i) // (100 * B) +    for j in range(B_limit + 1): +        if i == 0 and j == 0: +            continue +        sugar_limit = min(E * (A * i + B * j), F - 100 * (A * i + B * j)) +        sugar_ = 0 +        for c in range(sugar_limit // C + 1): +            d = (sugar_limit - c * C) // D +            temp_sugar = c * C + d * D +            sugar_ = max(sugar_, temp_sugar) +        temp_conc = sugar_ / (sugar_ + 100 * (A * i + B * j)) +        if temp_conc > max_conc: +            max_conc = temp_conc +            max_water = 100 * (A * i + B * j) +            max_sugar = sugar_ +print(("{0} {1}".format(max_water + max_sugar, max_sugar)))