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



mx = 0

mx_x = 100*A

mx_y = 0

for i in range(31):

    for j in range(16):

        for k in range(101):

            for l in range(51):

                if 100*A*i + 100*B*j + C*k + D*l > F: continue

                if (A*i + B*j)*E < C*k + D*l: continue

                a = 100*A*i + 100*B*j

                b = C*k + D*l

                if a > 0 and 100.0*b/(a + b) > mx:

                    mx_x = a + b

                    mx_y = b

                    mx = 100.0*b/(a + b)

print(mx_x, mx_y)

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



mx = 0

mx_x = 100*A

mx_y = 0

for i in range(31):

    for j in range(16):

        if i + j == 0 or 100*A*i + 100*B*j >= F: continue

        for k in range(101):

            for l in range(51):

                if 100*A*i + 100*B*j + C*k + D*l > F: continue

                if (A*i + B*j)*E < C*k + D*l: continue

                a = 100*A*i + 100*B*j

                b = C*k + D*l

                if 100.0*b/(a + b) > mx:

                    mx_x = a + b

                    mx_y = b

                    mx = 100.0*b/(a + b)

print(mx_x, mx_y)

A, B, C, D, E, F = list(map(int, input().split()))
mx = 0
mx_x = 100 * A
mx_y = 0
for i in range(31):
    for j in range(16):
        for k in range(101):
            for l in range(51):
                if 100 * A * i + 100 * B * j + C * k + D * l > F:
                    continue
                if (A * i + B * j) * E < C * k + D * l:
                    continue
                a = 100 * A * i + 100 * B * j
                b = C * k + D * l
                if a > 0 and 100.0 * b / (a + b) > mx:
                    mx_x = a + b
                    mx_y = b
                    mx = 100.0 * b / (a + b)
print(mx_x, mx_y)

A, B, C, D, E, F = list(map(int, input().split()))
mx = 0
mx_x = 100 * A
mx_y = 0
for i in range(31):
    for j in range(16):
        if i + j == 0 or 100 * A * i + 100 * B * j >= F:
            continue
        for k in range(101):
            for l in range(51):
                if 100 * A * i + 100 * B * j + C * k + D * l > F:
                    continue
                if (A * i + B * j) * E < C * k + D * l:
                    continue
                a = 100 * A * i + 100 * B * j
                b = C * k + D * l
                if 100.0 * b / (a + b) > mx:
                    mx_x = a + b
                    mx_y = b
                    mx = 100.0 * b / (a + b)
print(mx_x, mx_y)

+        if i + j == 0 or 100 * A * i + 100 * B * j >= F: +            continue -                if a > 0 and 100.0 * b / (a + b) > mx: +                if 100.0 * b / (a + b) > mx: