a,b,c,d,e,f = list(map(int,input().split()))

maxa = f//(100*a)



ans = [0,0,0]

for i in range(maxa+1): # iはAの回数

    for j in range((f-100*a*i)//b+1):

        v = 100*a*i + 100*b*j

        if f < v: continue

        for k in range((f-v)//d+1):

            for l in range((f-v-k*d)//c+1,-1,-1):

                s = c*l + d*k

                if v+s > f: continue

                if v/100*e < s: continue

                if v+s == 0: continue

                if ans[0] <= 100*s/(v+s):

                    ans = [100*s/(v+s),v+s,s]

                    break

print((*ans[1:]))
a,b,c,d,e,f = list(map(int,input().split()))

maxa = f//(100*a)



ans = [0,0,0]

for i in range(maxa+1): # iはAの回数

    for j in range((f-100*a*i)//b+1):

        v = 100*a*i + 100*b*j

        if f < v: break

        maxs = min(v*e//100,f-v)

        for k in range(maxs//d+1):

            l = (maxs-d*k)//c

            s = c*l + d*k

            if v+s > f: continue

            if v/100*e < s: continue

            if v+s == 0: continue

            if ans[0] <= 100*s/(v+s):

                ans = [100*s/(v+s),v+s,s]

print((*ans[1:]))
a, b, c, d, e, f = list(map(int, input().split()))
maxa = f // (100 * a)
ans = [0, 0, 0]
for i in range(maxa + 1):  # iはAの回数
    for j in range((f - 100 * a * i) // b + 1):
        v = 100 * a * i + 100 * b * j
        if f < v:
            continue
        for k in range((f - v) // d + 1):
            for l in range((f - v - k * d) // c + 1, -1, -1):
                s = c * l + d * k
                if v + s > f:
                    continue
                if v / 100 * e < s:
                    continue
                if v + s == 0:
                    continue
                if ans[0] <= 100 * s / (v + s):
                    ans = [100 * s / (v + s), v + s, s]
                    break
print((*ans[1:]))

a, b, c, d, e, f = list(map(int, input().split()))
maxa = f // (100 * a)
ans = [0, 0, 0]
for i in range(maxa + 1):  # iはAの回数
    for j in range((f - 100 * a * i) // b + 1):
        v = 100 * a * i + 100 * b * j
        if f < v:
            break
        maxs = min(v * e // 100, f - v)
        for k in range(maxs // d + 1):
            l = (maxs - d * k) // c
            s = c * l + d * k
            if v + s > f:
                continue
            if v / 100 * e < s:
                continue
            if v + s == 0:
                continue
            if ans[0] <= 100 * s / (v + s):
                ans = [100 * s / (v + s), v + s, s]
print((*ans[1:]))

-            continue -        for k in range((f - v) // d + 1): -            for l in range((f - v - k * d) // c + 1, -1, -1): -                s = c * l + d * k -                if v + s > f: -                    continue -                if v / 100 * e < s: -                    continue -                if v + s == 0: -                    continue -                if ans[0] <= 100 * s / (v + s): -                    ans = [100 * s / (v + s), v + s, s] -                    break +            break +        maxs = min(v * e // 100, f - v) +        for k in range(maxs // d + 1): +            l = (maxs - d * k) // c +            s = c * l + d * k +            if v + s > f: +                continue +            if v / 100 * e < s: +                continue +            if v + s == 0: +                continue +            if ans[0] <= 100 * s / (v + s): +                ans = [100 * s / (v + s), v + s, s]