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

water_list = []

for i in range(f+1):

    for j in range(f+1):

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

        if water <= f:

            water_list.append(water)

        else:

            break

            

sugar_list = []

for i in range(f+1):

    for j in range(f+1):

        sugar = c * i + d * j

        if sugar <= f:

            sugar_list.append(sugar)

        else:

            break

            

ans = []

for i in list(set(water_list)):

    for j in list(set(sugar_list)):

        if i != 0:

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

                ans.append((i+j, j))

                

ans_sorted = sorted(ans, key=lambda x: (x[1] / (x[0])))[-1]

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

water = []

for i in range(31):

    for j in range(31):

        if a * i * 100 + b * j * 100 > f:

            break

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

        

water = sorted(list(set(water)))

sugar = []

for i in range(3001):

    for j in range(3001):

        if c * i + d * j > f:

            break

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

        

sugar = sorted(list(set((sugar))))



sugar_ratio = 0

for i in water:

    for j in sugar:

        if i != 0:

            sugar_water = i + j

            if sugar_water <= f:

                if j / i  <= e / 100:

                    if j / sugar_water >= sugar_ratio:

                        sugar_ratio = j / sugar_water

                        ans_sugar_water = sugar_water

                        ans_sugar = j

                        

print((ans_sugar_water, ans_sugar))
a, b, c, d, e, f = list(map(int, input().split()))
water_list = []
for i in range(f + 1):
    for j in range(f + 1):
        water = a * 100 * i + b * 100 * j
        if water <= f:
            water_list.append(water)
        else:
            break
sugar_list = []
for i in range(f + 1):
    for j in range(f + 1):
        sugar = c * i + d * j
        if sugar <= f:
            sugar_list.append(sugar)
        else:
            break
ans = []
for i in list(set(water_list)):
    for j in list(set(sugar_list)):
        if i != 0:
            if float(j) / i <= e / 100 and (i + j) <= f:
                ans.append((i + j, j))
ans_sorted = sorted(ans, key=lambda x: (x[1] / (x[0])))[-1]
print((ans_sorted[0], ans_sorted[1]))

a, b, c, d, e, f = list(map(int, input().split()))
water = []
for i in range(31):
    for j in range(31):
        if a * i * 100 + b * j * 100 > f:
            break
        water.append(a * i * 100 + b * j * 100)
water = sorted(list(set(water)))
sugar = []
for i in range(3001):
    for j in range(3001):
        if c * i + d * j > f:
            break
        sugar.append(c * i + d * j)
sugar = sorted(list(set((sugar))))
sugar_ratio = 0
for i in water:
    for j in sugar:
        if i != 0:
            sugar_water = i + j
            if sugar_water <= f:
                if j / i <= e / 100:
                    if j / sugar_water >= sugar_ratio:
                        sugar_ratio = j / sugar_water
                        ans_sugar_water = sugar_water
                        ans_sugar = j
print((ans_sugar_water, ans_sugar))

-water_list = [] -for i in range(f + 1): -    for j in range(f + 1): -        water = a * 100 * i + b * 100 * j -        if water <= f: -            water_list.append(water) -        else: +water = [] +for i in range(31): +    for j in range(31): +        if a * i * 100 + b * j * 100 > f: -sugar_list = [] -for i in range(f + 1): -    for j in range(f + 1): -        sugar = c * i + d * j -        if sugar <= f: -            sugar_list.append(sugar) -        else: +        water.append(a * i * 100 + b * j * 100) +water = sorted(list(set(water))) +sugar = [] +for i in range(3001): +    for j in range(3001): +        if c * i + d * j > f: -ans = [] -for i in list(set(water_list)): -    for j in list(set(sugar_list)): +        sugar.append(c * i + d * j) +sugar = sorted(list(set((sugar)))) +sugar_ratio = 0 +for i in water: +    for j in sugar: -            if float(j) / i <= e / 100 and (i + j) <= f: -                ans.append((i + j, j)) -ans_sorted = sorted(ans, key=lambda x: (x[1] / (x[0])))[-1] -print((ans_sorted[0], ans_sorted[1])) +            sugar_water = i + j +            if sugar_water <= f: +                if j / i <= e / 100: +                    if j / sugar_water >= sugar_ratio: +                        sugar_ratio = j / sugar_water +                        ans_sugar_water = sugar_water +                        ans_sugar = j +print((ans_sugar_water, ans_sugar))