a,b,c,d,e,f = list(map(int,input().split()))

w = []

for i in range(f//100//a+1):

    for j in range(f//100//b+1):

        if (i*a + j*b)*100 <= f:

            w.append(i*100*a + j*100*b)

w = set(w)

w.remove(0)

s = []

for i in range(e*f//100//c+1):

    for j in range(e*f//100//d+1):

        if i*c + j*d <= e*f//100:

            s.append(i*c + j*d)

s = sorted(set(s))



ans = []

for i in w:

    for j in s:

        if i != 0 and j <= e* i//100 and i+j <= f:

            ans.append([j/(i+j), j+i, j])

ans.sort()

print((ans[-1][1], ans[-1][2]))
a,b,c,d,e,f = list(map(int,input().split()))

w = []

for i in range(f//100//a+1):

    for j in range(f//100//b+1):

        w.append(i*100*a + j*100*b)

w = set(w)

s = []

for i in range(f//c+1):

    for j in range(f//d+1):

        s.append(i*c + j*d)

s = set(s)

ans = []

for i in w:

    for j in s:

        if i != 0 and j/(i+j) <= e/(100+e) and i+j <= f:

            ans.append([j/(i+j), j+i, j])

ans.sort()

print((ans[-1][1], ans[-1][2]))
a, b, c, d, e, f = list(map(int, input().split()))
w = []
for i in range(f // 100 // a + 1):
    for j in range(f // 100 // b + 1):
        if (i * a + j * b) * 100 <= f:
            w.append(i * 100 * a + j * 100 * b)
w = set(w)
w.remove(0)
s = []
for i in range(e * f // 100 // c + 1):
    for j in range(e * f // 100 // d + 1):
        if i * c + j * d <= e * f // 100:
            s.append(i * c + j * d)
s = sorted(set(s))
ans = []
for i in w:
    for j in s:
        if i != 0 and j <= e * i // 100 and i + j <= f:
            ans.append([j / (i + j), j + i, j])
ans.sort()
print((ans[-1][1], ans[-1][2]))

a, b, c, d, e, f = list(map(int, input().split()))
w = []
for i in range(f // 100 // a + 1):
    for j in range(f // 100 // b + 1):
        w.append(i * 100 * a + j * 100 * b)
w = set(w)
s = []
for i in range(f // c + 1):
    for j in range(f // d + 1):
        s.append(i * c + j * d)
s = set(s)
ans = []
for i in w:
    for j in s:
        if i != 0 and j / (i + j) <= e / (100 + e) and i + j <= f:
            ans.append([j / (i + j), j + i, j])
ans.sort()
print((ans[-1][1], ans[-1][2]))

-        if (i * a + j * b) * 100 <= f: -            w.append(i * 100 * a + j * 100 * b) +        w.append(i * 100 * a + j * 100 * b) -w.remove(0) -for i in range(e * f // 100 // c + 1): -    for j in range(e * f // 100 // d + 1): -        if i * c + j * d <= e * f // 100: -            s.append(i * c + j * d) -s = sorted(set(s)) +for i in range(f // c + 1): +    for j in range(f // d + 1): +        s.append(i * c + j * d) +s = set(s) -        if i != 0 and j <= e * i // 100 and i + j <= f: +        if i != 0 and j / (i + j) <= e / (100 + e) and i + j <= f: