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()))



waters = set()

for w1 in range(0,F+1,B):

    if w1*100 > F: break

    for w2 in range(0,F+1,A):

        w = (w1+w2)*100

        if w > F: break

        if w==0: continue

        waters.add(w)



sugars = set()

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

    if s1 > F: break

    for s2 in range(0,F+1,C):

        s = s1+s2

        if s > F: break

        sugars.add(s)



ans_r = -1

ans_s = ans_w = None

for w in sorted(waters):

    if w > F: break

    for s in sorted(sugars):

        if w+s > F: break

        if s*100 > w*E: break

        r = 100*s/(s+w)

        if r > ans_r:

            ans_r = r

            ans_w = w

            ans_s = s

print((ans_s+ans_w, ans_s))

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()))
waters = set()
for w1 in range(0, F + 1, B):
    if w1 * 100 > F:
        break
    for w2 in range(0, F + 1, A):
        w = (w1 + w2) * 100
        if w > F:
            break
        if w == 0:
            continue
        waters.add(w)
sugars = set()
for s1 in range(0, F + 1, D):
    if s1 > F:
        break
    for s2 in range(0, F + 1, C):
        s = s1 + s2
        if s > F:
            break
        sugars.add(s)
ans_r = -1
ans_s = ans_w = None
for w in sorted(waters):
    if w > F:
        break
    for s in sorted(sugars):
        if w + s > F:
            break
        if s * 100 > w * E:
            break
        r = 100 * s / (s + w)
        if r > ans_r:
            ans_r = r
            ans_w = w
            ans_s = s
print((ans_s + ans_w, ans_s))

-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) +for w1 in range(0, F + 1, B): +    if w1 * 100 > F: +        break +    for w2 in range(0, F + 1, A): +        w = (w1 + w2) * 100 +        if w > F: +            break +        if w == 0: +            continue +        waters.add(w) -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 s1 in range(0, F + 1, D): +    if s1 > F: +        break +    for s2 in range(0, F + 1, C): +        s = s1 + s2 +        if s > F: +            break +        sugars.add(s) +ans_r = -1 +ans_s = ans_w = None +    if w > F: +        break -        if 100 * s > w * E: -            continue -            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)) +            break +        if s * 100 > w * E: +            break +        r = 100 * s / (s + w) +        if r > ans_r: +            ans_r = r +            ans_w = w +            ans_s = s +print((ans_s + ans_w, ans_s))