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

cmax = 0

x = 100*A

y = 0

for n in range(F//(100*A)+1):

    for m in range((F-n*100*A)//(100*B)+1):

        for l in range((F-n*100*A-m*100*B)//C+1):

            for k in range((F-n*100*A-m*100*B-l*C)//D+1):

#                 print("n,m,l,k={},{},{},{}".format(n,m,l,k))

                if n**2+m**2>0 and l*C+k*D<=E*(n*A+m*B):

#                     print("d={}".format((l*C+k*D)/(n*100*A+m*100*B+l*C+k*D)))

                    if cmax<(l*C+k*D)/(n*100*A+m*100*B+l*C+k*D):

                        cmax = (l*C+k*D)/(n*100*A+m*100*B+l*C+k*D)

                        x = n*100*A+m*100*B

                        y = l*C+k*D

                    

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

xmax = 100*A

kmax = 0

for n in range(31):

    for m in range(31):

        x = 100*(n*A+m*B)

        ymax = min((n*A+m*B)*E,F-100*(n*A+m*B))

        for k in range(ymax,ymax-C-1,-1):

            t = 0

            flag = 0

            while k-t*D>=0:

                if (k-t*D)%C==0:

                    flag = 1

                    break

                t += 1

            if flag==1:

                if kmax*(x+k)<k*(xmax+kmax):

                    xmax = x

                    kmax = k

print((xmax+kmax,kmax))
A, B, C, D, E, F = list(map(int, input().split()))
cmax = 0
x = 100 * A
y = 0
for n in range(F // (100 * A) + 1):
    for m in range((F - n * 100 * A) // (100 * B) + 1):
        for l in range((F - n * 100 * A - m * 100 * B) // C + 1):
            for k in range((F - n * 100 * A - m * 100 * B - l * C) // D + 1):
                #                 print("n,m,l,k={},{},{},{}".format(n,m,l,k))
                if n**2 + m**2 > 0 and l * C + k * D <= E * (n * A + m * B):
                    #                     print("d={}".format((l*C+k*D)/(n*100*A+m*100*B+l*C+k*D)))
                    if cmax < (l * C + k * D) / (
                        n * 100 * A + m * 100 * B + l * C + k * D
                    ):
                        cmax = (l * C + k * D) / (
                            n * 100 * A + m * 100 * B + l * C + k * D
                        )
                        x = n * 100 * A + m * 100 * B
                        y = l * C + k * D
print((x + y, y))

A, B, C, D, E, F = list(map(int, input().split()))
xmax = 100 * A
kmax = 0
for n in range(31):
    for m in range(31):
        x = 100 * (n * A + m * B)
        ymax = min((n * A + m * B) * E, F - 100 * (n * A + m * B))
        for k in range(ymax, ymax - C - 1, -1):
            t = 0
            flag = 0
            while k - t * D >= 0:
                if (k - t * D) % C == 0:
                    flag = 1
                    break
                t += 1
            if flag == 1:
                if kmax * (x + k) < k * (xmax + kmax):
                    xmax = x
                    kmax = k
print((xmax + kmax, kmax))

-cmax = 0 -x = 100 * A -y = 0 -for n in range(F // (100 * A) + 1): -    for m in range((F - n * 100 * A) // (100 * B) + 1): -        for l in range((F - n * 100 * A - m * 100 * B) // C + 1): -            for k in range((F - n * 100 * A - m * 100 * B - l * C) // D + 1): -                #                 print("n,m,l,k={},{},{},{}".format(n,m,l,k)) -                if n**2 + m**2 > 0 and l * C + k * D <= E * (n * A + m * B): -                    #                     print("d={}".format((l*C+k*D)/(n*100*A+m*100*B+l*C+k*D))) -                    if cmax < (l * C + k * D) / ( -                        n * 100 * A + m * 100 * B + l * C + k * D -                    ): -                        cmax = (l * C + k * D) / ( -                            n * 100 * A + m * 100 * B + l * C + k * D -                        ) -                        x = n * 100 * A + m * 100 * B -                        y = l * C + k * D -print((x + y, y)) +xmax = 100 * A +kmax = 0 +for n in range(31): +    for m in range(31): +        x = 100 * (n * A + m * B) +        ymax = min((n * A + m * B) * E, F - 100 * (n * A + m * B)) +        for k in range(ymax, ymax - C - 1, -1): +            t = 0 +            flag = 0 +            while k - t * D >= 0: +                if (k - t * D) % C == 0: +                    flag = 1 +                    break +                t += 1 +            if flag == 1: +                if kmax * (x + k) < k * (xmax + kmax): +                    xmax = x +                    kmax = k +print((xmax + kmax, kmax))