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 b in range(0, F+1, 100*B):

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

        waters.add(a+b)

waters.remove(0)



sugars = set()

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

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

        sugars.add(c+d)



best_w = best_s = best_r = -1

for water in sorted(waters):

    for sugar in sorted(sugars):

        if water + sugar > F: break

        if water*E < sugar*100: break

        rate = sugar / (water + sugar)

        if rate > best_r:

            best_r = rate

            best_w = water

            best_s = sugar

print((best_s+best_w, 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 b in range(0, F + 1, 100 * B):
    for a in range(0, F - b + 1, 100 * A):
        waters.add(a + b)
waters.remove(0)
sugars = set()
for d in range(0, F + 1, D):
    for c in range(0, F - d + 1, C):
        sugars.add(c + d)
best_w = best_s = best_r = -1
for water in sorted(waters):
    for sugar in sorted(sugars):
        if water + sugar > F:
            break
        if water * E < sugar * 100:
            break
        rate = sugar / (water + sugar)
        if rate > best_r:
            best_r = rate
            best_w = water
            best_s = sugar
print((best_s + best_w, best_s))

-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: +for b in range(0, F + 1, 100 * B): +    for a in range(0, F - b + 1, 100 * A): +        waters.add(a + b) +waters.remove(0) +sugars = set() +for d in range(0, F + 1, D): +    for c in range(0, F - d + 1, C): +        sugars.add(c + d) +best_w = best_s = best_r = -1 +for water in sorted(waters): +    for sugar in sorted(sugars): +        if water + sugar > F: -        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: +        if water * E < sugar * 100: -        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)) +        rate = sugar / (water + sugar) +        if rate > best_r: +            best_r = rate +            best_w = water +            best_s = sugar +print((best_s + best_w, best_s))