# -*- coding: utf-8 -*-



def calcCons(nA, nB, nC, nD):

    W = nA*a*100 + nB*b*100

    S = nC*c + nD*d

    if W+S == 0:

        return -1

    return 100*S/(W+S)





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





maxCons = 0

answer_W, answer_S = 0, 0



nA, nB, nC, nD = 0, 0, 0, 0

while nA*a*100 + nB*b*100 + nC*c + nD*d <= f:

    # Operation A

    while nA*a*100 + nB*b*100 + nC*c + nD*d <= f:

        # Operation B

        while nA*a*100 + nB*b*100 + nC*c + nD*d <= f:

            # Operation C

            while nA*a*100 + nB*b*100 + nC*c + nD*d <= f:

                # Operation D

                cons = calcCons(nA, nB, nC, nD)

                # print("{} {} {} {} {}".format(cons, nA, nB, nC, nD))

                if cons > maxCons and cons <= 100*e/(100+e):

                    maxCons = cons

                    answer_W, answer_S = nA*a*100 + nB*b*100, nC*c + nD*d

                nD += 1

            nD = 0

            nC += 1

        nC = 0

        nB += 1

    nB = 0

    nA += 1



if maxCons == 0:

    answer_W = a*100

print(("{} {}".format(int(answer_W+answer_S), int(answer_S))))

def calcCons(nA, nB, nC, nD):

    W = (nA * a + nB * b) * 100

    S = nC * c + nD * d

    if W + S == 0:

        return -1

    return S / (W + S)





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

nA, nB, nC, nD, W, S, M = 0, 0, 0, 0, 0, 0, 0

while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:

    while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:

        while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:

            while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:

                cons = calcCons(nA, nB, nC, nD)

                if cons > M and cons <= e / (100 + e):

                    M = cons

                    W, S = nA * a * 100 + nB * b * 100, nC * c + nD * d

                nD += 1

            nD = 0

            nC += 1

        nC = 0

        nB += 1

    nB = 0

    nA += 1



if M == 0:

    W = a * 100

print((W + S, S))

# -*- coding: utf-8 -*-
def calcCons(nA, nB, nC, nD):
    W = nA * a * 100 + nB * b * 100
    S = nC * c + nD * d
    if W + S == 0:
        return -1
    return 100 * S / (W + S)


a, b, c, d, e, f = list(map(int, input().split()))
maxCons = 0
answer_W, answer_S = 0, 0
nA, nB, nC, nD = 0, 0, 0, 0
while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
    # Operation A
    while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
        # Operation B
        while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
            # Operation C
            while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
                # Operation D
                cons = calcCons(nA, nB, nC, nD)
                # print("{} {} {} {} {}".format(cons, nA, nB, nC, nD))
                if cons > maxCons and cons <= 100 * e / (100 + e):
                    maxCons = cons
                    answer_W, answer_S = nA * a * 100 + nB * b * 100, nC * c + nD * d
                nD += 1
            nD = 0
            nC += 1
        nC = 0
        nB += 1
    nB = 0
    nA += 1
if maxCons == 0:
    answer_W = a * 100
print(("{} {}".format(int(answer_W + answer_S), int(answer_S))))

def calcCons(nA, nB, nC, nD):
    W = (nA * a + nB * b) * 100
    S = nC * c + nD * d
    if W + S == 0:
        return -1
    return S / (W + S)


a, b, c, d, e, f = list(map(int, input().split()))
nA, nB, nC, nD, W, S, M = 0, 0, 0, 0, 0, 0, 0
while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
    while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
        while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
            while nA * a * 100 + nB * b * 100 + nC * c + nD * d <= f:
                cons = calcCons(nA, nB, nC, nD)
                if cons > M and cons <= e / (100 + e):
                    M = cons
                    W, S = nA * a * 100 + nB * b * 100, nC * c + nD * d
                nD += 1
            nD = 0
            nC += 1
        nC = 0
        nB += 1
    nB = 0
    nA += 1
if M == 0:
    W = a * 100
print((W + S, S))

-# -*- coding: utf-8 -*- -    W = nA * a * 100 + nB * b * 100 +    W = (nA * a + nB * b) * 100 -    return 100 * S / (W + S) +    return S / (W + S) -maxCons = 0 -answer_W, answer_S = 0, 0 -nA, nB, nC, nD = 0, 0, 0, 0 +nA, nB, nC, nD, W, S, M = 0, 0, 0, 0, 0, 0, 0 -    # Operation A -        # Operation B -            # Operation C -                # Operation D -                # print("{} {} {} {} {}".format(cons, nA, nB, nC, nD)) -                if cons > maxCons and cons <= 100 * e / (100 + e): -                    maxCons = cons -                    answer_W, answer_S = nA * a * 100 + nB * b * 100, nC * c + nD * d +                if cons > M and cons <= e / (100 + e): +                    M = cons +                    W, S = nA * a * 100 + nB * b * 100, nC * c + nD * d -if maxCons == 0: -    answer_W = a * 100 -print(("{} {}".format(int(answer_W + answer_S), int(answer_S)))) +if M == 0: +    W = a * 100 +print((W + S, S))