a,b,c,d,e,f=list(map(int,input().split()))#ć­Łč§Ł

w=[]

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

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

        x=100*a*i+100*b*j

        if x<=f:

            w.append(x)

s=[]

for i in range(f):

    for j in range(f):

        y=i*c+j*d

        if y<=f:

            s.append(y)

max_con=0

ans,ans_2=0,0

for i in w:

    for j in s:

        if i!=0 or j!=0:

            if j<=e*(i//100):

                if i+j<=f:

                    con=(100*j)/(i+j)

                    if max_con<=con:

                        max_con=con

                        ans,ans_2=i+j,j

print((ans,ans_2))

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

water=[]

sugar=[]

ans,ans_2,con=0,0,0

for i in range(f//100+1):#f//100+1によりTLEを解消

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

        x=100*a*i+100*j*b

        if x<=f:

            water.append(x)

for i in range(f):

    for j in range(f):

        y=c*i+d*j

        if y<=f:

            sugar.append(y)

sugar=list(set(sugar))

for i in water:

    for j in sugar:

        if i+j<=f:

            if i!=0 or j!=0:

                if j<=(i//100)*e:

                    now=(100*j)/(i+j)

                    if con<=now:

                        ans=i+j

                        ans_2=j

                        con=now

print((ans,ans_2))

a, b, c, d, e, f = list(map(int, input().split()))  # ć­Łč§Ł
w = []
for i in range(f // 100 + 1):
    for j in range(f // 100 + 1):
        x = 100 * a * i + 100 * b * j
        if x <= f:
            w.append(x)
s = []
for i in range(f):
    for j in range(f):
        y = i * c + j * d
        if y <= f:
            s.append(y)
max_con = 0
ans, ans_2 = 0, 0
for i in w:
    for j in s:
        if i != 0 or j != 0:
            if j <= e * (i // 100):
                if i + j <= f:
                    con = (100 * j) / (i + j)
                    if max_con <= con:
                        max_con = con
                        ans, ans_2 = i + j, j
print((ans, ans_2))

a, b, c, d, e, f = list(map(int, input().split()))
water = []
sugar = []
ans, ans_2, con = 0, 0, 0
for i in range(f // 100 + 1):  # f//100+1によりTLEを解消
    for j in range(f // 100 + 1):
        x = 100 * a * i + 100 * j * b
        if x <= f:
            water.append(x)
for i in range(f):
    for j in range(f):
        y = c * i + d * j
        if y <= f:
            sugar.append(y)
sugar = list(set(sugar))
for i in water:
    for j in sugar:
        if i + j <= f:
            if i != 0 or j != 0:
                if j <= (i // 100) * e:
                    now = (100 * j) / (i + j)
                    if con <= now:
                        ans = i + j
                        ans_2 = j
                        con = now
print((ans, ans_2))

-a, b, c, d, e, f = list(map(int, input().split()))  # ć­Łč§Ł -w = [] -for i in range(f // 100 + 1): +a, b, c, d, e, f = list(map(int, input().split())) +water = [] +sugar = [] +ans, ans_2, con = 0, 0, 0 +for i in range(f // 100 + 1):  # f//100+1によりTLEを解消 -        x = 100 * a * i + 100 * b * j +        x = 100 * a * i + 100 * j * b -            w.append(x) -s = [] +            water.append(x) -        y = i * c + j * d +        y = c * i + d * j -            s.append(y) -max_con = 0 -ans, ans_2 = 0, 0 -for i in w: -    for j in s: -        if i != 0 or j != 0: -            if j <= e * (i // 100): -                if i + j <= f: -                    con = (100 * j) / (i + j) -                    if max_con <= con: -                        max_con = con -                        ans, ans_2 = i + j, j +            sugar.append(y) +sugar = list(set(sugar)) +for i in water: +    for j in sugar: +        if i + j <= f: +            if i != 0 or j != 0: +                if j <= (i // 100) * e: +                    now = (100 * j) / (i + j) +                    if con <= now: +                        ans = i + j +                        ans_2 = j +                        con = now