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



ans,index=0,[a*100,0]

base=100*e/(100+e)

for i in range(31):

    for j in range(31):

        for k in range(101):

            for l in range(101):

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

                s=c*k+d*l

                if w==0:continue

                if w+s>f:break

                den=s*100/(w+s)

                if den<=base and ans<den:

                    ans=den

                    index=[w+s,s]



print((*index))
inf=10**8

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

a,b=100*a,100*b

DP=[inf]*(f+max(a,b)+1)

DP[a],DP[b]=0,0



for i in range(f+1):

    if DP[i]!=inf:

        DP[i+a]=DP[i]

        DP[i+b]=DP[i]

        for j in c,d:

            if 100*(DP[i]+j)/(i+j)<=100*e/(100+e):

                DP[i+j]=max(DP[i],DP[i]+j)



ans,index=0,[a,0]

for i in range(f+1):

    if DP[i]!=inf:

        if ans<100*DP[i]/i:

            ans=100*DP[i]/i

            index=[i,DP[i]]



print((*index))
a, b, c, d, e, f = list(map(int, input().split()))
ans, index = 0, [a * 100, 0]
base = 100 * e / (100 + e)
for i in range(31):
    for j in range(31):
        for k in range(101):
            for l in range(101):
                w = i * 100 * a + j * 100 * b
                s = c * k + d * l
                if w == 0:
                    continue
                if w + s > f:
                    break
                den = s * 100 / (w + s)
                if den <= base and ans < den:
                    ans = den
                    index = [w + s, s]
print((*index))

inf = 10**8
a, b, c, d, e, f = list(map(int, input().split()))
a, b = 100 * a, 100 * b
DP = [inf] * (f + max(a, b) + 1)
DP[a], DP[b] = 0, 0
for i in range(f + 1):
    if DP[i] != inf:
        DP[i + a] = DP[i]
        DP[i + b] = DP[i]
        for j in c, d:
            if 100 * (DP[i] + j) / (i + j) <= 100 * e / (100 + e):
                DP[i + j] = max(DP[i], DP[i] + j)
ans, index = 0, [a, 0]
for i in range(f + 1):
    if DP[i] != inf:
        if ans < 100 * DP[i] / i:
            ans = 100 * DP[i] / i
            index = [i, DP[i]]
print((*index))

+inf = 10**8 -ans, index = 0, [a * 100, 0] -base = 100 * e / (100 + e) -for i in range(31): -    for j in range(31): -        for k in range(101): -            for l in range(101): -                w = i * 100 * a + j * 100 * b -                s = c * k + d * l -                if w == 0: -                    continue -                if w + s > f: -                    break -                den = s * 100 / (w + s) -                if den <= base and ans < den: -                    ans = den -                    index = [w + s, s] +a, b = 100 * a, 100 * b +DP = [inf] * (f + max(a, b) + 1) +DP[a], DP[b] = 0, 0 +for i in range(f + 1): +    if DP[i] != inf: +        DP[i + a] = DP[i] +        DP[i + b] = DP[i] +        for j in c, d: +            if 100 * (DP[i] + j) / (i + j) <= 100 * e / (100 + e): +                DP[i + j] = max(DP[i], DP[i] + j) +ans, index = 0, [a, 0] +for i in range(f + 1): +    if DP[i] != inf: +        if ans < 100 * DP[i] / i: +            ans = 100 * DP[i] / i +            index = [i, DP[i]]