import math

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

water = A

suger = 0

for a in range(31):

    for b in range(31):

        subwater = A * a + B * b

        if subwater == 0:

                continue

        for c in range(1501):

            subsuger = C * c

            if subsuger <= subwater * E:

                if F - subwater * 100 - subsuger > 0:

                    subsuger += D * min((F - subwater * 100 - subsuger) // D, (subwater * E - subsuger) // D)

                if subsuger <= subwater * E and subwater * 100 + subsuger <= F and subsuger / (subwater * 100 + subsuger) > suger / (water * 100 + suger):

                    water = subwater

                    suger = subsuger

print(("{} {}".format(water * 100 + suger, suger)))
import math

import bisect

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

x = [A * a + B * b for b in range(31) for a in range(31)]

y = [C * c + D * d for d in range(1501) for c in range(1501)]

x.remove(0)

x = list(set(x))

y = list(set(y))

x.sort()

y.sort()

x = x[:bisect.bisect_right(x,F//100+1)]

y = y[:bisect.bisect_left(y,F)]





water = A

suger = 0

for i in x:

    for j in y:

        if j <= i * E and i * 100 + j <= F:

            if j / (i * 100 + j) > suger / (water * 100 + suger):

                water = i

                suger = j

print(("{} {}".format(water * 100 + suger, suger)))
import math

A, B, C, D, E, F = list(map(int, input().split()))
water = A
suger = 0
for a in range(31):
    for b in range(31):
        subwater = A * a + B * b
        if subwater == 0:
            continue
        for c in range(1501):
            subsuger = C * c
            if subsuger <= subwater * E:
                if F - subwater * 100 - subsuger > 0:
                    subsuger += D * min(
                        (F - subwater * 100 - subsuger) // D,
                        (subwater * E - subsuger) // D,
                    )
                if (
                    subsuger <= subwater * E
                    and subwater * 100 + subsuger <= F
                    and subsuger / (subwater * 100 + subsuger)
                    > suger / (water * 100 + suger)
                ):
                    water = subwater
                    suger = subsuger
print(("{} {}".format(water * 100 + suger, suger)))

import math
import bisect

A, B, C, D, E, F = list(map(int, input().split()))
x = [A * a + B * b for b in range(31) for a in range(31)]
y = [C * c + D * d for d in range(1501) for c in range(1501)]
x.remove(0)
x = list(set(x))
y = list(set(y))
x.sort()
y.sort()
x = x[: bisect.bisect_right(x, F // 100 + 1)]
y = y[: bisect.bisect_left(y, F)]
water = A
suger = 0
for i in x:
    for j in y:
        if j <= i * E and i * 100 + j <= F:
            if j / (i * 100 + j) > suger / (water * 100 + suger):
                water = i
                suger = j
print(("{} {}".format(water * 100 + suger, suger)))

+import bisect +x = [A * a + B * b for b in range(31) for a in range(31)] +y = [C * c + D * d for d in range(1501) for c in range(1501)] +x.remove(0) +x = list(set(x)) +y = list(set(y)) +x.sort() +y.sort() +x = x[: bisect.bisect_right(x, F // 100 + 1)] +y = y[: bisect.bisect_left(y, F)] -for a in range(31): -    for b in range(31): -        subwater = A * a + B * b -        if subwater == 0: -            continue -        for c in range(1501): -            subsuger = C * c -            if subsuger <= subwater * E: -                if F - subwater * 100 - subsuger > 0: -                    subsuger += D * min( -                        (F - subwater * 100 - subsuger) // D, -                        (subwater * E - subsuger) // D, -                    ) -                if ( -                    subsuger <= subwater * E -                    and subwater * 100 + subsuger <= F -                    and subsuger / (subwater * 100 + subsuger) -                    > suger / (water * 100 + suger) -                ): -                    water = subwater -                    suger = subsuger +for i in x: +    for j in y: +        if j <= i * E and i * 100 + j <= F: +            if j / (i * 100 + j) > suger / (water * 100 + suger): +                water = i +                suger = j