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

rec = (0, 0)

ma = 0

for i in range(31):

    for j in range(31):

        for k in range(100):

            t = i * a * 100 + j * b * 100 + c * k

            if t > f:

                break

            for l in range(100):

                s = i * a * 100 + j * b * 100 + c * k + d * l

                if s > f:

                    break

                if c * k + d * l > (a * i + b * j) * e:

                    break

                if (i * a + j * b + c * k + d * l) == 0:

                    continue

                q = (c * k + d * l) / (100 * i * a + 100 * j * b + c * k + d * l) * 100

                if q >= ma:

                    ma = q

                    rec = (s, c * k + d * l)



print((rec[0], rec[1]))
A, B, C, D, E, F = list(map(int, input().split()))

num = (0, 0)

rec = 0

for a in range(101):

    for b in range(101):

        if a * A * 100 + b * B * 100 > F:

            break

        for c in range(100):

            if a * A * 100 + b * B * 100 + c * C > F:

                break

            for d in range(100):

                q = a * A * 100 + b * B * 100

                p = C * c + D * d

                if p > E * (a * A + b * B):

                    continue

                if p + q == 0:

                    continue

                if p + q <= F:

                    if rec <= 100 * p / (p + q):

                        rec = 100 * p / (p + q)

                        num = (p + q, p)

                else:

                    break



print((num[0], num[1]))
a, b, c, d, e, f = list(map(int, input().split()))
rec = (0, 0)
ma = 0
for i in range(31):
    for j in range(31):
        for k in range(100):
            t = i * a * 100 + j * b * 100 + c * k
            if t > f:
                break
            for l in range(100):
                s = i * a * 100 + j * b * 100 + c * k + d * l
                if s > f:
                    break
                if c * k + d * l > (a * i + b * j) * e:
                    break
                if (i * a + j * b + c * k + d * l) == 0:
                    continue
                q = (c * k + d * l) / (100 * i * a + 100 * j * b + c * k + d * l) * 100
                if q >= ma:
                    ma = q
                    rec = (s, c * k + d * l)
print((rec[0], rec[1]))

A, B, C, D, E, F = list(map(int, input().split()))
num = (0, 0)
rec = 0
for a in range(101):
    for b in range(101):
        if a * A * 100 + b * B * 100 > F:
            break
        for c in range(100):
            if a * A * 100 + b * B * 100 + c * C > F:
                break
            for d in range(100):
                q = a * A * 100 + b * B * 100
                p = C * c + D * d
                if p > E * (a * A + b * B):
                    continue
                if p + q == 0:
                    continue
                if p + q <= F:
                    if rec <= 100 * p / (p + q):
                        rec = 100 * p / (p + q)
                        num = (p + q, p)
                else:
                    break
print((num[0], num[1]))

-a, b, c, d, e, f = list(map(int, input().split())) -rec = (0, 0) -ma = 0 -for i in range(31): -    for j in range(31): -        for k in range(100): -            t = i * a * 100 + j * b * 100 + c * k -            if t > f: +A, B, C, D, E, F = list(map(int, input().split())) +num = (0, 0) +rec = 0 +for a in range(101): +    for b in range(101): +        if a * A * 100 + b * B * 100 > F: +            break +        for c in range(100): +            if a * A * 100 + b * B * 100 + c * C > F: -            for l in range(100): -                s = i * a * 100 + j * b * 100 + c * k + d * l -                if s > f: +            for d in range(100): +                q = a * A * 100 + b * B * 100 +                p = C * c + D * d +                if p > E * (a * A + b * B): +                    continue +                if p + q == 0: +                    continue +                if p + q <= F: +                    if rec <= 100 * p / (p + q): +                        rec = 100 * p / (p + q) +                        num = (p + q, p) +                else: -                if c * k + d * l > (a * i + b * j) * e: -                    break -                if (i * a + j * b + c * k + d * l) == 0: -                    continue -                q = (c * k + d * l) / (100 * i * a + 100 * j * b + c * k + d * l) * 100 -                if q >= ma: -                    ma = q -                    rec = (s, c * k + d * l) -print((rec[0], rec[1])) +print((num[0], num[1]))