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



water=set()

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

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

    if a+b<=F: water.add(a+b)

water=sorted(list(water))



suger=set()

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

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

    if c+d<=F: suger.add(c+d)

suger=sorted(list(suger))



ans,answater,anssuger=0,0,0

for w in water:

  for s in suger:

    if (w//100)*E<s or w+s>F: break

    if w+s!=0:

      if ans<=(100*s)/(w+s):

        answater,anssuger=w+s,s

        ans=(100*s)/(w+s)

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



water=set()

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

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

    if a+b<=F: water.add(a+b)

water=sorted(list(water))

suger=set()

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

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

    if c+d<=F: suger.add(c+d)

suger=sorted(list(suger))



kosa,ans1,ans2=0,0,0

for w in water:

  for s in suger:

    if (w//100)*E<s or w+s>F: break

    if w+s!=0 and kosa<=(100*s) / (w+s):

      kosa=(100*s) / (w+s)

      ans1,ans2=w+s,s

print((ans1,ans2))
A, B, C, D, E, F = list(map(int, input().split()))
water = set()
for a in range(0, F + 1, 100 * A):
    for b in range(0, F + 1, 100 * B):
        if a + b <= F:
            water.add(a + b)
water = sorted(list(water))
suger = set()
for c in range(0, F + 1, C):
    for d in range(0, F + 1, D):
        if c + d <= F:
            suger.add(c + d)
suger = sorted(list(suger))
ans, answater, anssuger = 0, 0, 0
for w in water:
    for s in suger:
        if (w // 100) * E < s or w + s > F:
            break
        if w + s != 0:
            if ans <= (100 * s) / (w + s):
                answater, anssuger = w + s, s
                ans = (100 * s) / (w + s)
print((answater, anssuger))

A, B, C, D, E, F = list(map(int, input().split()))
water = set()
for a in range(0, F + 1, 100 * A):
    for b in range(0, F + 1, 100 * B):
        if a + b <= F:
            water.add(a + b)
water = sorted(list(water))
suger = set()
for c in range(0, F + 1, C):
    for d in range(0, F + 1, D):
        if c + d <= F:
            suger.add(c + d)
suger = sorted(list(suger))
kosa, ans1, ans2 = 0, 0, 0
for w in water:
    for s in suger:
        if (w // 100) * E < s or w + s > F:
            break
        if w + s != 0 and kosa <= (100 * s) / (w + s):
            kosa = (100 * s) / (w + s)
            ans1, ans2 = w + s, s
print((ans1, ans2))

-ans, answater, anssuger = 0, 0, 0 +kosa, ans1, ans2 = 0, 0, 0 -        if w + s != 0: -            if ans <= (100 * s) / (w + s): -                answater, anssuger = w + s, s -                ans = (100 * s) / (w + s) -print((answater, anssuger)) +        if w + s != 0 and kosa <= (100 * s) / (w + s): +            kosa = (100 * s) / (w + s) +            ans1, ans2 = w + s, s +print((ans1, ans2))