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



water = set()

for i in range(F//(100*A) + 1):

    for j in range(F // (100*B) + 1):

        if 100*A * i + 100*j*B <= F:

            water |= {100*A * i + 100*j*B}

        else:

            break



sugar = set()

for i in range(F//C + 1):

    for j in range(F // D + 1):

        if C * i + D*j <= F:

            sugar |= {C * i + D*j}

        else:

            break

ans = [100*A, 0]

for x in water:

    if x == 0:

        continue

    for y in sugar:

        if x + y <= F and y <= (x/100)*E:

            if ans[1]/ans[0] < y / (x+y):

                ans = [x+y, y]



print((ans[0], ans[1]))

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



A *= 100

B *= 100

dp = [-1]*(F+1)

if A <= F:

    dp[A] = 0

if B <= F:

    dp[B] = 0

for i in range(A, F + 1):

    if A <= i:

        dp[i] = max(dp[i - A], dp[i])

    if B <= i:

        dp[i] = max(dp[i - B], dp[i])

    if C <= i and dp[i-C] >= 0:

        if dp[i-C] + C <= (i-C - dp[i-C]) * (E / 100):

            dp[i] = max(dp[i-C] + C, dp[i])

    if D <= i and dp[i-D] >= 0:

        if dp[i-D] + D <= (i - D - dp[i-D]) * (E / 100):

            dp[i] = max(dp[i-D] + D, dp[i])





x = 0

id = 0

for i in range(A, F+1):

    if x <= (dp[i] / (i)):

        x = dp[i] / (i)

        id = i

print((id, dp[id]))

A, B, C, D, E, F = list(map(int, input().split()))
water = set()
for i in range(F // (100 * A) + 1):
    for j in range(F // (100 * B) + 1):
        if 100 * A * i + 100 * j * B <= F:
            water |= {100 * A * i + 100 * j * B}
        else:
            break
sugar = set()
for i in range(F // C + 1):
    for j in range(F // D + 1):
        if C * i + D * j <= F:
            sugar |= {C * i + D * j}
        else:
            break
ans = [100 * A, 0]
for x in water:
    if x == 0:
        continue
    for y in sugar:
        if x + y <= F and y <= (x / 100) * E:
            if ans[1] / ans[0] < y / (x + y):
                ans = [x + y, y]
print((ans[0], ans[1]))

A, B, C, D, E, F = list(map(int, input().split()))
A *= 100
B *= 100
dp = [-1] * (F + 1)
if A <= F:
    dp[A] = 0
if B <= F:
    dp[B] = 0
for i in range(A, F + 1):
    if A <= i:
        dp[i] = max(dp[i - A], dp[i])
    if B <= i:
        dp[i] = max(dp[i - B], dp[i])
    if C <= i and dp[i - C] >= 0:
        if dp[i - C] + C <= (i - C - dp[i - C]) * (E / 100):
            dp[i] = max(dp[i - C] + C, dp[i])
    if D <= i and dp[i - D] >= 0:
        if dp[i - D] + D <= (i - D - dp[i - D]) * (E / 100):
            dp[i] = max(dp[i - D] + D, dp[i])
x = 0
id = 0
for i in range(A, F + 1):
    if x <= (dp[i] / (i)):
        x = dp[i] / (i)
        id = i
print((id, dp[id]))

-water = set() -for i in range(F // (100 * A) + 1): -    for j in range(F // (100 * B) + 1): -        if 100 * A * i + 100 * j * B <= F: -            water |= {100 * A * i + 100 * j * B} -        else: -            break -sugar = set() -for i in range(F // C + 1): -    for j in range(F // D + 1): -        if C * i + D * j <= F: -            sugar |= {C * i + D * j} -        else: -            break -ans = [100 * A, 0] -for x in water: -    if x == 0: -        continue -    for y in sugar: -        if x + y <= F and y <= (x / 100) * E: -            if ans[1] / ans[0] < y / (x + y): -                ans = [x + y, y] -print((ans[0], ans[1])) +A *= 100 +B *= 100 +dp = [-1] * (F + 1) +if A <= F: +    dp[A] = 0 +if B <= F: +    dp[B] = 0 +for i in range(A, F + 1): +    if A <= i: +        dp[i] = max(dp[i - A], dp[i]) +    if B <= i: +        dp[i] = max(dp[i - B], dp[i]) +    if C <= i and dp[i - C] >= 0: +        if dp[i - C] + C <= (i - C - dp[i - C]) * (E / 100): +            dp[i] = max(dp[i - C] + C, dp[i]) +    if D <= i and dp[i - D] >= 0: +        if dp[i - D] + D <= (i - D - dp[i - D]) * (E / 100): +            dp[i] = max(dp[i - D] + D, dp[i]) +x = 0 +id = 0 +for i in range(A, F + 1): +    if x <= (dp[i] / (i)): +        x = dp[i] / (i) +        id = i +print((id, dp[id]))