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



ans_con = -1

max_con = E/(100+E)*100



a = 0

while F >= 100*A*a:

    b = 0

    while F-100*A*a >= 100*B*b:

        water = 100*(A*a+B*b)

        c = 0

        while F-water >= C*c:

            d = 0

            while F-water-C*c >= D*d:

                sugar = C*c+D*d

                mass = water + sugar

                if 0 < mass <= F:

                    con = sugar/mass*100

                    if ans_con < con <= max_con:

                        ans_con = con

                        ans_mass = mass

                        ans_sugar = sugar

                d += 1

            c += 1

        b += 1

    a += 1



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



ans_con = -1

max_con = E/(100+E)*100



a = 0

while F >= 100*A*a:

    b = 0

    while F-100*A*a >= 100*B*b:

        water = 100*(A*a+B*b)

        c = 0

        while F-water >= C*c:

            sugar = C*c+D*max(min(((F-water-C*c)//D),(water*E/100-C*c)//D),0)

            mass = water + sugar

            if 0 < mass <= F:

                con = sugar/mass*100

                if ans_con < con <= max_con:

                    ans_con = con

                    ans_mass = mass

                    ans_sugar = sugar

            c += 1

        b += 1

    a += 1



print((int(ans_mass), int(ans_sugar)))
A, B, C, D, E, F = list(map(int, input().split()))
ans_con = -1
max_con = E / (100 + E) * 100
a = 0
while F >= 100 * A * a:
    b = 0
    while F - 100 * A * a >= 100 * B * b:
        water = 100 * (A * a + B * b)
        c = 0
        while F - water >= C * c:
            d = 0
            while F - water - C * c >= D * d:
                sugar = C * c + D * d
                mass = water + sugar
                if 0 < mass <= F:
                    con = sugar / mass * 100
                    if ans_con < con <= max_con:
                        ans_con = con
                        ans_mass = mass
                        ans_sugar = sugar
                d += 1
            c += 1
        b += 1
    a += 1
print((int(ans_mass), int(ans_sugar)))

A, B, C, D, E, F = list(map(int, input().split()))
ans_con = -1
max_con = E / (100 + E) * 100
a = 0
while F >= 100 * A * a:
    b = 0
    while F - 100 * A * a >= 100 * B * b:
        water = 100 * (A * a + B * b)
        c = 0
        while F - water >= C * c:
            sugar = C * c + D * max(
                min(((F - water - C * c) // D), (water * E / 100 - C * c) // D), 0
            )
            mass = water + sugar
            if 0 < mass <= F:
                con = sugar / mass * 100
                if ans_con < con <= max_con:
                    ans_con = con
                    ans_mass = mass
                    ans_sugar = sugar
            c += 1
        b += 1
    a += 1
print((int(ans_mass), int(ans_sugar)))

-            d = 0 -            while F - water - C * c >= D * d: -                sugar = C * c + D * d -                mass = water + sugar -                if 0 < mass <= F: -                    con = sugar / mass * 100 -                    if ans_con < con <= max_con: -                        ans_con = con -                        ans_mass = mass -                        ans_sugar = sugar -                d += 1 +            sugar = C * c + D * max( +                min(((F - water - C * c) // D), (water * E / 100 - C * c) // D), 0 +            ) +            mass = water + sugar +            if 0 < mass <= F: +                con = sugar / mass * 100 +                if ans_con < con <= max_con: +                    ans_con = con +                    ans_mass = mass +                    ans_sugar = sugar