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

W = set()

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

    for b in range(0, F+1, 100*B):

        W.add(a+b)

S = set()

for c in range(0, F+1, C):

    for d in range(0, F+1, D):

        S.add(c+d)



rate = -1

for w in W:

    for s in S:

        if 0 < w + s <= F and s * 100 <= E * w:

            if s / (s + w) > rate:

                rate = s / (s + w)

                ans = w + s, s

print((ans[0], ans[1]))
A, B, C, D, E, F = list(map(int, input().split()))



ws = set()

ss = set()

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

    for b in range(0, F+1-a, B*100):

        ws.add(a + b)



for c in range(0, F+1, C):

    for d in range(0, F+1-c, D):

        ss.add(c + d)



mx = -1

ans = 0, 0

for w in ws:

    if w == 0:

        continue

    for s in ss:

        x = s * 100 / w

        if w + s <= F and x <= E and mx < x:

            mx = x

            ans = s + w, s



print((*ans))

A, B, C, D, E, F = list(map(int, input().split()))
W = set()
for a in range(0, F + 1, 100 * A):
    for b in range(0, F + 1, 100 * B):
        W.add(a + b)
S = set()
for c in range(0, F + 1, C):
    for d in range(0, F + 1, D):
        S.add(c + d)
rate = -1
for w in W:
    for s in S:
        if 0 < w + s <= F and s * 100 <= E * w:
            if s / (s + w) > rate:
                rate = s / (s + w)
                ans = w + s, s
print((ans[0], ans[1]))

A, B, C, D, E, F = list(map(int, input().split()))
ws = set()
ss = set()
for a in range(0, F + 1, A * 100):
    for b in range(0, F + 1 - a, B * 100):
        ws.add(a + b)
for c in range(0, F + 1, C):
    for d in range(0, F + 1 - c, D):
        ss.add(c + d)
mx = -1
ans = 0, 0
for w in ws:
    if w == 0:
        continue
    for s in ss:
        x = s * 100 / w
        if w + s <= F and x <= E and mx < x:
            mx = x
            ans = s + w, s
print((*ans))

-W = set() -for a in range(0, F + 1, 100 * A): -    for b in range(0, F + 1, 100 * B): -        W.add(a + b) -S = set() +ws = set() +ss = set() +for a in range(0, F + 1, A * 100): +    for b in range(0, F + 1 - a, B * 100): +        ws.add(a + b) -    for d in range(0, F + 1, D): -        S.add(c + d) -rate = -1 -for w in W: -    for s in S: -        if 0 < w + s <= F and s * 100 <= E * w: -            if s / (s + w) > rate: -                rate = s / (s + w) -                ans = w + s, s -print((ans[0], ans[1])) +    for d in range(0, F + 1 - c, D): +        ss.add(c + d) +mx = -1 +ans = 0, 0 +for w in ws: +    if w == 0: +        continue +    for s in ss: +        x = s * 100 / w +        if w + s <= F and x <= E and mx < x: +            mx = x +            ans = s + w, s +print((*ans))