#!/usr/bin/env python3





def main():

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

    ans = [100*A,0]

    # 水の量で全探索する

    N = F // (100*A)

    M = F // (100*B)

    for i in range(N+1):

        for j in range(M+1):

            if i == j == 0:# 水なしはだめ

                continue

            water = 100*A*i + 100*B*j

            if water > F:

                continue

            K = (F - water) // C

            L = (F - water) // D

            for k in range(K+1):

                for l in range(L+1):

                    sugar = C*k + D*l

                    if sugar > (A*i + B*j) * E:# 溶け残りはだめ

                        continue

                    if water + sugar > F:# 溢れたらだめ

                        continue

                    if ans[1] / ans[0] < sugar / (sugar+water):

                        ans = [water+sugar, sugar]

            

    print((*ans))

                    



if __name__ == "__main__":

    main()

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

res = 0

ans = [100*A,0]# sugar+water, sugar



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

    for y in range((F-100*A*x)//(100*B)+1):

        if x == y == 0: continue

        sugarMAX = (A*x+B*y)*E

        M = F-100*A*x-100*B*y

        water = 100*A*x+100*B*y

        for z in range(M//C+1):

            for w in range((M-C*z)//D+1):

                sugar = C*z+D*w

                if sugar <= sugarMAX:

                    if ans[1]*(sugar+water) < sugar*ans[0]:

                        ans = [sugar+water, sugar]

                else:

                    break

print((*ans))
#!/usr/bin/env python3
def main():
    A, B, C, D, E, F = list(map(int, input().split()))
    ans = [100 * A, 0]
    # 水の量で全探索する
    N = F // (100 * A)
    M = F // (100 * B)
    for i in range(N + 1):
        for j in range(M + 1):
            if i == j == 0:  # 水なしはだめ
                continue
            water = 100 * A * i + 100 * B * j
            if water > F:
                continue
            K = (F - water) // C
            L = (F - water) // D
            for k in range(K + 1):
                for l in range(L + 1):
                    sugar = C * k + D * l
                    if sugar > (A * i + B * j) * E:  # 溶け残りはだめ
                        continue
                    if water + sugar > F:  # 溢れたらだめ
                        continue
                    if ans[1] / ans[0] < sugar / (sugar + water):
                        ans = [water + sugar, sugar]
    print((*ans))


if __name__ == "__main__":
    main()

A, B, C, D, E, F = list(map(int, input().split()))
res = 0
ans = [100 * A, 0]  # sugar+water, sugar
for x in range(F // (100 * A) + 1):
    for y in range((F - 100 * A * x) // (100 * B) + 1):
        if x == y == 0:
            continue
        sugarMAX = (A * x + B * y) * E
        M = F - 100 * A * x - 100 * B * y
        water = 100 * A * x + 100 * B * y
        for z in range(M // C + 1):
            for w in range((M - C * z) // D + 1):
                sugar = C * z + D * w
                if sugar <= sugarMAX:
                    if ans[1] * (sugar + water) < sugar * ans[0]:
                        ans = [sugar + water, sugar]
                else:
                    break
print((*ans))

-#!/usr/bin/env python3 -def main(): -    A, B, C, D, E, F = list(map(int, input().split())) -    ans = [100 * A, 0] -    # 水の量で全探索する -    N = F // (100 * A) -    M = F // (100 * B) -    for i in range(N + 1): -        for j in range(M + 1): -            if i == j == 0:  # 水なしはだめ -                continue -            water = 100 * A * i + 100 * B * j -            if water > F: -                continue -            K = (F - water) // C -            L = (F - water) // D -            for k in range(K + 1): -                for l in range(L + 1): -                    sugar = C * k + D * l -                    if sugar > (A * i + B * j) * E:  # 溶け残りはだめ -                        continue -                    if water + sugar > F:  # 溢れたらだめ -                        continue -                    if ans[1] / ans[0] < sugar / (sugar + water): -                        ans = [water + sugar, sugar] -    print((*ans)) - - -if __name__ == "__main__": -    main() +A, B, C, D, E, F = list(map(int, input().split())) +res = 0 +ans = [100 * A, 0]  # sugar+water, sugar +for x in range(F // (100 * A) + 1): +    for y in range((F - 100 * A * x) // (100 * B) + 1): +        if x == y == 0: +            continue +        sugarMAX = (A * x + B * y) * E +        M = F - 100 * A * x - 100 * B * y +        water = 100 * A * x + 100 * B * y +        for z in range(M // C + 1): +            for w in range((M - C * z) // D + 1): +                sugar = C * z + D * w +                if sugar <= sugarMAX: +                    if ans[1] * (sugar + water) < sugar * ans[0]: +                        ans = [sugar + water, sugar] +                else: +                    break +print((*ans))