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



ws = set()

i = j = 0

while True:

    j = 0

    if B*i > F//100: break

    while True:

        w = B*i + A*j

        if w > F//100: break

        ws.add(w)

        j += 1

    i += 1

ws = list(ws)

ws.sort()



ss = set()

i = j = 0

while True:

    j = 0

    if D*i > F: break

    while True:

        s = D*i + C*j

        if s > F: break

        ss.add(s)

        j += 1

    i += 1

ss = list(ss)

ss.sort()



limit = E / (100+E)

water = A*100

sugar = rate = 0

for w in ws:

    w = w*100

    if w == 0: continue

    if w > F: break

    for s in ss:

        if w+s > F: break

        r = s / (w+s)

        if r > limit: break

        if r > rate:

            rate = r

            water = w

            sugar = s

print((water+sugar, sugar))

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



waters = set()

for wb in range(0,F+1,100*B):

    wa = 0

    while wa + wb <= F:

        waters.add(wa + wb)

        wa += 100*A

waters.remove(0)



sugars = set()

for sd in range(0,F+1,D):

    sc = 0

    while sc + sd <= F:

        sugars.add(sc + sd)

        sc += C



best = -1

best_w = best_s = 0

for w in sorted(waters):

    for s in sorted(sugars):

        if 100*s > w*E: continue

        if w+s > F: continue

        if best < 100*s / (w+s):

            best = 100*s / (w+s)

            best_w = w

            best_s = s



print((best_w+best_s, best_s))
A, B, C, D, E, F = list(map(int, input().split()))
ws = set()
i = j = 0
while True:
    j = 0
    if B * i > F // 100:
        break
    while True:
        w = B * i + A * j
        if w > F // 100:
            break
        ws.add(w)
        j += 1
    i += 1
ws = list(ws)
ws.sort()
ss = set()
i = j = 0
while True:
    j = 0
    if D * i > F:
        break
    while True:
        s = D * i + C * j
        if s > F:
            break
        ss.add(s)
        j += 1
    i += 1
ss = list(ss)
ss.sort()
limit = E / (100 + E)
water = A * 100
sugar = rate = 0
for w in ws:
    w = w * 100
    if w == 0:
        continue
    if w > F:
        break
    for s in ss:
        if w + s > F:
            break
        r = s / (w + s)
        if r > limit:
            break
        if r > rate:
            rate = r
            water = w
            sugar = s
print((water + sugar, sugar))

A, B, C, D, E, F = list(map(int, input().split()))
waters = set()
for wb in range(0, F + 1, 100 * B):
    wa = 0
    while wa + wb <= F:
        waters.add(wa + wb)
        wa += 100 * A
waters.remove(0)
sugars = set()
for sd in range(0, F + 1, D):
    sc = 0
    while sc + sd <= F:
        sugars.add(sc + sd)
        sc += C
best = -1
best_w = best_s = 0
for w in sorted(waters):
    for s in sorted(sugars):
        if 100 * s > w * E:
            continue
        if w + s > F:
            continue
        if best < 100 * s / (w + s):
            best = 100 * s / (w + s)
            best_w = w
            best_s = s
print((best_w + best_s, best_s))

-ws = set() -i = j = 0 -while True: -    j = 0 -    if B * i > F // 100: -        break -    while True: -        w = B * i + A * j -        if w > F // 100: -            break -        ws.add(w) -        j += 1 -    i += 1 -ws = list(ws) -ws.sort() -ss = set() -i = j = 0 -while True: -    j = 0 -    if D * i > F: -        break -    while True: -        s = D * i + C * j -        if s > F: -            break -        ss.add(s) -        j += 1 -    i += 1 -ss = list(ss) -ss.sort() -limit = E / (100 + E) -water = A * 100 -sugar = rate = 0 -for w in ws: -    w = w * 100 -    if w == 0: -        continue -    if w > F: -        break -    for s in ss: +waters = set() +for wb in range(0, F + 1, 100 * B): +    wa = 0 +    while wa + wb <= F: +        waters.add(wa + wb) +        wa += 100 * A +waters.remove(0) +sugars = set() +for sd in range(0, F + 1, D): +    sc = 0 +    while sc + sd <= F: +        sugars.add(sc + sd) +        sc += C +best = -1 +best_w = best_s = 0 +for w in sorted(waters): +    for s in sorted(sugars): +        if 100 * s > w * E: +            continue -            break -        r = s / (w + s) -        if r > limit: -            break -        if r > rate: -            rate = r -            water = w -            sugar = s -print((water + sugar, sugar)) +            continue +        if best < 100 * s / (w + s): +            best = 100 * s / (w + s) +            best_w = w +            best_s = s +print((best_w + best_s, best_s))