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

 

x = set()

y = set()

 

for i in range(F // (100 * A) + 1):

    for j in range((F - 100 * A * i) // (100 * B) + 1):

        if i + j == 0:

            continue

        x.add(A * i * 100 + B * j * 100)

 

for i in range(F // C + 1):

    for j in range((F - C * i) // D + 1):

        y.add(C * i + D * j)

 

ret_w = 1

ret_s = -1

 

for w in x:

    for s in y:

        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w:

            ret_s = s

            ret_w = w + s

 

print((ret_w, ret_s))




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

#x is a list which represents for the volumn of water

x = set()



#y is a list which represents for the volumn of sugar

y = set()



for i in range(F//C+1):

    for j in range((F-C*i)//D+1):

        #if i + j == 0:

            #continue

        y.add( i * C + j * D)



for i in range(F//(100 * A)+1):

    for j in range((F-100*A*i)//(100*B)+1):

        if i + j == 0:

            continue

        x.add(i * A * 100 + j * B * 100)

#print(x)

#print(y)

ans_sweetwater = 1

ans_sugar = -1

#ans_density = -1

#density = E/(100+E)

#print("density: ",density)

for m in x:

    for n in y:

        #tmp_density = n/(m+n)

        if m + n <= F and m*E/100 >= n and ans_sugar/ans_sweetwater <= n/(m+n):

            ans_sweetwater =  m + n

            ans_sugar = n

            #ans_density = tmp_density

print((ans_sweetwater,ans_sugar))

A, B, C, D, E, F = list(map(int, input().split()))
x = set()
y = set()
for i in range(F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        if i + j == 0:
            continue
        x.add(A * i * 100 + B * j * 100)
for i in range(F // C + 1):
    for j in range((F - C * i) // D + 1):
        y.add(C * i + D * j)
ret_w = 1
ret_s = -1
for w in x:
    for s in y:
        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w:
            ret_s = s
            ret_w = w + s
print((ret_w, ret_s))

A, B, C, D, E, F = list(map(int, input().split()))
# x is a list which represents for the volumn of water
x = set()
# y is a list which represents for the volumn of sugar
y = set()
for i in range(F // C + 1):
    for j in range((F - C * i) // D + 1):
        # if i + j == 0:
        # continue
        y.add(i * C + j * D)
for i in range(F // (100 * A) + 1):
    for j in range((F - 100 * A * i) // (100 * B) + 1):
        if i + j == 0:
            continue
        x.add(i * A * 100 + j * B * 100)
# print(x)
# print(y)
ans_sweetwater = 1
ans_sugar = -1
# ans_density = -1
# density = E/(100+E)
# print("density: ",density)
for m in x:
    for n in y:
        # tmp_density = n/(m+n)
        if (
            m + n <= F
            and m * E / 100 >= n
            and ans_sugar / ans_sweetwater <= n / (m + n)
        ):
            ans_sweetwater = m + n
            ans_sugar = n
            # ans_density = tmp_density
print((ans_sweetwater, ans_sugar))

+# x is a list which represents for the volumn of water +# y is a list which represents for the volumn of sugar +for i in range(F // C + 1): +    for j in range((F - C * i) // D + 1): +        # if i + j == 0: +        # continue +        y.add(i * C + j * D) -        x.add(A * i * 100 + B * j * 100) -for i in range(F // C + 1): -    for j in range((F - C * i) // D + 1): -        y.add(C * i + D * j) -ret_w = 1 -ret_s = -1 -for w in x: -    for s in y: -        if w + s <= F and w * E / 100 >= s and s / (w + s) >= ret_s / ret_w: -            ret_s = s -            ret_w = w + s -print((ret_w, ret_s)) +        x.add(i * A * 100 + j * B * 100) +# print(x) +# print(y) +ans_sweetwater = 1 +ans_sugar = -1 +# ans_density = -1 +# density = E/(100+E) +# print("density: ",density) +for m in x: +    for n in y: +        # tmp_density = n/(m+n) +        if ( +            m + n <= F +            and m * E / 100 >= n +            and ans_sugar / ans_sweetwater <= n / (m + n) +        ): +            ans_sweetwater = m + n +            ans_sugar = n +            # ans_density = tmp_density +print((ans_sweetwater, ans_sugar))