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



ret_w = 1

ret_s = -1

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

    w_a = a * A * 100

    for b in range((F - w_a) // (100 * B) + 1):

        if a + b == 0:

            continue

        w_b = b * B * 100



        max_suger = min(F - w_a - w_b, (w_a + w_b) // 100 * E)

        for c in range(max_suger // C + 1):

            s_c = c * C

            for d in range((max_suger - s_c) // D + 1):

                s_d = d * D

                if ret_s / ret_w < (s_c + s_d) / (w_a + w_b + s_c + s_d):

                    ret_s = s_c + s_d

                    ret_w = ret_s + w_a + w_b



print((ret_w, ret_s))



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



x = set()

y = set()



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

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

        if i + j == 0:

            continue

        x.add(A * i * 100 + B * j * 100)



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

    for j in range((F - C * i) // D + 1):

        y.add(C * i + D * j)



ret_w = 1

ret_s = -1



for w in x:

    for s in y:

        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w:

            ret_s = s

            ret_w = w + s



print((ret_w, ret_s))

A, B, C, D, E, F = list(map(int, input().split()))
ret_w = 1
ret_s = -1
for a in range(F // (100 * A) + 1):
    w_a = a * A * 100
    for b in range((F - w_a) // (100 * B) + 1):
        if a + b == 0:
            continue
        w_b = b * B * 100
        max_suger = min(F - w_a - w_b, (w_a + w_b) // 100 * E)
        for c in range(max_suger // C + 1):
            s_c = c * C
            for d in range((max_suger - s_c) // D + 1):
                s_d = d * D
                if ret_s / ret_w < (s_c + s_d) / (w_a + w_b + s_c + s_d):
                    ret_s = s_c + s_d
                    ret_w = ret_s + w_a + w_b
print((ret_w, ret_s))

A, B, C, D, E, F = list(map(int, input().split()))
x = set()
y = set()
for i in range(F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        if i + j == 0:
            continue
        x.add(A * i * 100 + B * j * 100)
for i in range(F // C + 1):
    for j in range((F - C * i) // D + 1):
        y.add(C * i + D * j)
ret_w = 1
ret_s = -1
for w in x:
    for s in y:
        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w:
            ret_s = s
            ret_w = w + s
print((ret_w, ret_s))

+x = set() +y = set() +for i in range(F // (100 * A) + 1): +    for j in range((F - 100 * A * i) // (100 * B) + 1): +        if i + j == 0: +            continue +        x.add(A * i * 100 + B * j * 100) +for i in range(F // C + 1): +    for j in range((F - C * i) // D + 1): +        y.add(C * i + D * j) -for a in range(F // (100 * A) + 1): -    w_a = a * A * 100 -    for b in range((F - w_a) // (100 * B) + 1): -        if a + b == 0: -            continue -        w_b = b * B * 100 -        max_suger = min(F - w_a - w_b, (w_a + w_b) // 100 * E) -        for c in range(max_suger // C + 1): -            s_c = c * C -            for d in range((max_suger - s_c) // D + 1): -                s_d = d * D -                if ret_s / ret_w < (s_c + s_d) / (w_a + w_b + s_c + s_d): -                    ret_s = s_c + s_d -                    ret_w = ret_s + w_a + w_b +for w in x: +    for s in y: +        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w: +            ret_s = s +            ret_w = w + s