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



ws = set()

for a in range(F+1):

    if a*100*A > F: break

    for b in range(F+1):

        if a*100*A + b*100*B > F: break

        ws.add(a*100*A + b*100*B)



ss = set()

for c in range(F+1):

    if c*C > F: break

    for d in range(F+1):

        if c*C + d*D > F: break

        ss.add(c*C + d*D)



os = -1

ow = 999

for w in ws:

    if w==0: continue

    for s in ss:

        if s+w > F: continue

        if w*E < s*100: continue

        if os * (s+w) < s * (os+ow):

            os,ow = s,w

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



ws = set()

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

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

        if a+b > F: break

        ws.add(a+b)

ws.remove(0)



ss = set()

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

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

        if c+d > F: break

        ss.add(c+d)



best_s = -1

best_w = 1

for w in ws:

    for s in ss:

        if w+s > F: continue

        if E*w < s*100: continue

        if best_s * (s+w) < s * (best_s + best_w):

            best_s = s

            best_w = w

print((best_s+best_w, best_s))
A, B, C, D, E, F = list(map(int, input().split()))
ws = set()
for a in range(F + 1):
    if a * 100 * A > F:
        break
    for b in range(F + 1):
        if a * 100 * A + b * 100 * B > F:
            break
        ws.add(a * 100 * A + b * 100 * B)
ss = set()
for c in range(F + 1):
    if c * C > F:
        break
    for d in range(F + 1):
        if c * C + d * D > F:
            break
        ss.add(c * C + d * D)
os = -1
ow = 999
for w in ws:
    if w == 0:
        continue
    for s in ss:
        if s + w > F:
            continue
        if w * E < s * 100:
            continue
        if os * (s + w) < s * (os + ow):
            os, ow = s, w
print((os + ow, os))

A, B, C, D, E, F = list(map(int, input().split()))
ws = set()
for a in range(0, F + 1, 100 * A):
    for b in range(0, F + 1, 100 * B):
        if a + b > F:
            break
        ws.add(a + b)
ws.remove(0)
ss = set()
for c in range(0, F + 1, C):
    for d in range(0, F + 1, D):
        if c + d > F:
            break
        ss.add(c + d)
best_s = -1
best_w = 1
for w in ws:
    for s in ss:
        if w + s > F:
            continue
        if E * w < s * 100:
            continue
        if best_s * (s + w) < s * (best_s + best_w):
            best_s = s
            best_w = w
print((best_s + best_w, best_s))

-for a in range(F + 1): -    if a * 100 * A > F: -        break -    for b in range(F + 1): -        if a * 100 * A + b * 100 * B > F: +for a in range(0, F + 1, 100 * A): +    for b in range(0, F + 1, 100 * B): +        if a + b > F: -        ws.add(a * 100 * A + b * 100 * B) +        ws.add(a + b) +ws.remove(0) -for c in range(F + 1): -    if c * C > F: -        break -    for d in range(F + 1): -        if c * C + d * D > F: +for c in range(0, F + 1, C): +    for d in range(0, F + 1, D): +        if c + d > F: -        ss.add(c * C + d * D) -os = -1 -ow = 999 +        ss.add(c + d) +best_s = -1 +best_w = 1 -    if w == 0: -        continue -        if s + w > F: +        if w + s > F: -        if w * E < s * 100: +        if E * w < s * 100: -        if os * (s + w) < s * (os + ow): -            os, ow = s, w -print((os + ow, os)) +        if best_s * (s + w) < s * (best_s + best_w): +            best_s = s +            best_w = w +print((best_s + best_w, best_s))