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

a, b = 100 * a, 100 * b

limit = 100 * e / (100 + e)

mx = -1



for i in range(f // a + 1):

    for j in range((f - i * a) // b + 1):

        for k in range((f - i * a - j * b) // c + 1):

            for l in range((f - i * a - j * b - k * c) // d + 1):

                water = i * a + j * b + k * c + l * d

                sugar = k * c + l * d

                if water > f or water == 0:

                    break

                if (100 * sugar / water) <= limit:

                    if (100 * sugar / water) > mx:

                        mx = (100 * sugar / water)

                        x, y = water, sugar

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

limit = 100 * e / (100 + e)

mx = -1



waters = set()

for i in range(0, f + 1, 100 * a):

    for j in range(0, f + 1, 100 * b):

        if i + j <= f:

            waters.add(i + j)



sugars = set()

for i in range(0, f + 1, c):

    for j in range(0, f + 1, d):

        if i + j <= f:

            sugars.add(i + j)



for i in waters:

    for j in sugars:

        if i + j <= f and i + j != 0:

            noudo = 100 * j / (i + j)

            if noudo <= limit:

                if noudo > mx:

                    mx = noudo

                    x, y = i + j, j

print((x, y))
a, b, c, d, e, f = list(map(int, input().split()))
a, b = 100 * a, 100 * b
limit = 100 * e / (100 + e)
mx = -1
for i in range(f // a + 1):
    for j in range((f - i * a) // b + 1):
        for k in range((f - i * a - j * b) // c + 1):
            for l in range((f - i * a - j * b - k * c) // d + 1):
                water = i * a + j * b + k * c + l * d
                sugar = k * c + l * d
                if water > f or water == 0:
                    break
                if (100 * sugar / water) <= limit:
                    if (100 * sugar / water) > mx:
                        mx = 100 * sugar / water
                        x, y = water, sugar
print((x, y))

a, b, c, d, e, f = list(map(int, input().split()))
limit = 100 * e / (100 + e)
mx = -1
waters = set()
for i in range(0, f + 1, 100 * a):
    for j in range(0, f + 1, 100 * b):
        if i + j <= f:
            waters.add(i + j)
sugars = set()
for i in range(0, f + 1, c):
    for j in range(0, f + 1, d):
        if i + j <= f:
            sugars.add(i + j)
for i in waters:
    for j in sugars:
        if i + j <= f and i + j != 0:
            noudo = 100 * j / (i + j)
            if noudo <= limit:
                if noudo > mx:
                    mx = noudo
                    x, y = i + j, j
print((x, y))

-a, b = 100 * a, 100 * b -for i in range(f // a + 1): -    for j in range((f - i * a) // b + 1): -        for k in range((f - i * a - j * b) // c + 1): -            for l in range((f - i * a - j * b - k * c) // d + 1): -                water = i * a + j * b + k * c + l * d -                sugar = k * c + l * d -                if water > f or water == 0: -                    break -                if (100 * sugar / water) <= limit: -                    if (100 * sugar / water) > mx: -                        mx = 100 * sugar / water -                        x, y = water, sugar +waters = set() +for i in range(0, f + 1, 100 * a): +    for j in range(0, f + 1, 100 * b): +        if i + j <= f: +            waters.add(i + j) +sugars = set() +for i in range(0, f + 1, c): +    for j in range(0, f + 1, d): +        if i + j <= f: +            sugars.add(i + j) +for i in waters: +    for j in sugars: +        if i + j <= f and i + j != 0: +            noudo = 100 * j / (i + j) +            if noudo <= limit: +                if noudo > mx: +                    mx = noudo +                    x, y = i + j, j