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()))

a = 0

x = 100*A

y = 0

for n in range(30):

    for m in range(30):

        if n*100*A+m*100*B>F:continue

        c = (n*A+m*B)*E

        d = F-100*(n*A+m*B)

        for k in range(min(c,d)+1):

            for l in range(min(c,d)+1):

                if k*C+l*D>(n*A+m*B)*E or n*100*A+m*100*B+k*C+l*D>F:continue

                if x*(k*C+l*D)>y*(n*100*A+m*100*B+k*C+l*D):

                    x = n*100*A+m*100*B+k*C+l*D

                    y = k*C+l*D

                    a = y/x

print((x,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()))
a = 0
x = 100 * A
y = 0
for n in range(30):
    for m in range(30):
        if n * 100 * A + m * 100 * B > F:
            continue
        c = (n * A + m * B) * E
        d = F - 100 * (n * A + m * B)
        for k in range(min(c, d) + 1):
            for l in range(min(c, d) + 1):
                if (
                    k * C + l * D > (n * A + m * B) * E
                    or n * 100 * A + m * 100 * B + k * C + l * D > F
                ):
                    continue
                if x * (k * C + l * D) > y * (
                    n * 100 * A + m * 100 * B + k * C + l * D
                ):
                    x = n * 100 * A + m * 100 * B + k * C + l * D
                    y = k * C + l * D
                    a = y / x
print((x, 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)) +a = 0 +x = 100 * A +y = 0 +for n in range(30): +    for m in range(30): +        if n * 100 * A + m * 100 * B > F: +            continue +        c = (n * A + m * B) * E +        d = F - 100 * (n * A + m * B) +        for k in range(min(c, d) + 1): +            for l in range(min(c, d) + 1): +                if ( +                    k * C + l * D > (n * A + m * B) * E +                    or n * 100 * A + m * 100 * B + k * C + l * D > F +                ): +                    continue +                if x * (k * C + l * D) > y * ( +                    n * 100 * A + m * 100 * B + k * C + l * D +                ): +                    x = n * 100 * A + m * 100 * B + k * C + l * D +                    y = k * C + l * D +                    a = y / x +print((x, y))