import sys

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





def concentration(water, suger):

    if water * E/100 < suger or water + suger == 0:

        return 0

    return (100 * suger/(water + suger))



lst_w = []

limit_w = (F+A*100-1)//(A*100)

for i in range(limit_w):

    for j in range(limit_w):

        if 100 * (A * i + B * j) <= F:

            lst_w += [100 * (A * i + B * j)]



lst_s = []

limit_s = (F+C-1)//C

for i in range(limit_s):

    for j in range(limit_s):

        if C* i + D * j <= F:

            lst_s += [C * i + D * j]



# print (lst_w)

# print (lst_s)

set_w = set(lst_w)

set_s = set(lst_s)



# print (set_w)

# print (set_s)



ans = 0

ans_total = 0

ans_suger = 0

for water in set_w:

    for suger in set_s:

        if water + suger <= F:

            a = concentration(water, suger)

            if ans < a:

                ans = a

                ans_total = water + suger

                ans_suger = suger

            if ans == 50:

                print((ans_total, ans_suger))

                sys.exit()



if ans == 0:

    print((A * 100, 0))

else:

    print((ans_total, ans_suger))



# print (ans)

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



total = 100 * A

sugar = 0



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

    for b in range((F - (100 * a)) // (100 * B) + 1):

        tmp_water = 100 * (A * a + B * b)

        if tmp_water == 0:

            continue

        

        maxC = min(tmp_water // 100 * E, F - tmp_water) #溶ける量とビーカーの質量の問題

        

        if maxC <= 0:

            continue



        # print (tmp_water)



        for c in range(0, maxC + 1, C): #Cグラム刻みで増やす

            # print ('c', c)

            left = maxC - c

            d = (left // D) * D

            tmp_sugar = c + d

            tmp_total = tmp_sugar + tmp_water

            if sugar * tmp_total < tmp_sugar * total:

                total = tmp_total

                sugar = tmp_sugar



print((total, sugar))

            
import sys

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


def concentration(water, suger):
    if water * E / 100 < suger or water + suger == 0:
        return 0
    return 100 * suger / (water + suger)


lst_w = []
limit_w = (F + A * 100 - 1) // (A * 100)
for i in range(limit_w):
    for j in range(limit_w):
        if 100 * (A * i + B * j) <= F:
            lst_w += [100 * (A * i + B * j)]
lst_s = []
limit_s = (F + C - 1) // C
for i in range(limit_s):
    for j in range(limit_s):
        if C * i + D * j <= F:
            lst_s += [C * i + D * j]
# print (lst_w)
# print (lst_s)
set_w = set(lst_w)
set_s = set(lst_s)
# print (set_w)
# print (set_s)
ans = 0
ans_total = 0
ans_suger = 0
for water in set_w:
    for suger in set_s:
        if water + suger <= F:
            a = concentration(water, suger)
            if ans < a:
                ans = a
                ans_total = water + suger
                ans_suger = suger
            if ans == 50:
                print((ans_total, ans_suger))
                sys.exit()
if ans == 0:
    print((A * 100, 0))
else:
    print((ans_total, ans_suger))
# print (ans)

A, B, C, D, E, F = list(map(int, input().split()))
total = 100 * A
sugar = 0
for a in range(F // (100 * A) + 1):
    for b in range((F - (100 * a)) // (100 * B) + 1):
        tmp_water = 100 * (A * a + B * b)
        if tmp_water == 0:
            continue
        maxC = min(tmp_water // 100 * E, F - tmp_water)  # 溶ける量とビーカーの質量の問題
        if maxC <= 0:
            continue
        # print (tmp_water)
        for c in range(0, maxC + 1, C):  # Cグラム刻みで増やす
            # print ('c', c)
            left = maxC - c
            d = (left // D) * D
            tmp_sugar = c + d
            tmp_total = tmp_sugar + tmp_water
            if sugar * tmp_total < tmp_sugar * total:
                total = tmp_total
                sugar = tmp_sugar
print((total, sugar))

-import sys - - - -def concentration(water, suger): -    if water * E / 100 < suger or water + suger == 0: -        return 0 -    return 100 * suger / (water + suger) - - -lst_w = [] -limit_w = (F + A * 100 - 1) // (A * 100) -for i in range(limit_w): -    for j in range(limit_w): -        if 100 * (A * i + B * j) <= F: -            lst_w += [100 * (A * i + B * j)] -lst_s = [] -limit_s = (F + C - 1) // C -for i in range(limit_s): -    for j in range(limit_s): -        if C * i + D * j <= F: -            lst_s += [C * i + D * j] -# print (lst_w) -# print (lst_s) -set_w = set(lst_w) -set_s = set(lst_s) -# print (set_w) -# print (set_s) -ans = 0 -ans_total = 0 -ans_suger = 0 -for water in set_w: -    for suger in set_s: -        if water + suger <= F: -            a = concentration(water, suger) -            if ans < a: -                ans = a -                ans_total = water + suger -                ans_suger = suger -            if ans == 50: -                print((ans_total, ans_suger)) -                sys.exit() -if ans == 0: -    print((A * 100, 0)) -else: -    print((ans_total, ans_suger)) -# print (ans) +total = 100 * A +sugar = 0 +for a in range(F // (100 * A) + 1): +    for b in range((F - (100 * a)) // (100 * B) + 1): +        tmp_water = 100 * (A * a + B * b) +        if tmp_water == 0: +            continue +        maxC = min(tmp_water // 100 * E, F - tmp_water)  # 溶ける量とビーカーの質量の問題 +        if maxC <= 0: +            continue +        # print (tmp_water) +        for c in range(0, maxC + 1, C):  # Cグラム刻みで増やす +            # print ('c', c) +            left = maxC - c +            d = (left // D) * D +            tmp_sugar = c + d +            tmp_total = tmp_sugar + tmp_water +            if sugar * tmp_total < tmp_sugar * total: +                total = tmp_total +                sugar = tmp_sugar +print((total, sugar))