def solve():

    

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

    memo = {}

    

    for a in range(31):

        for b in range(31):

            for c in range(101):

                for d in range(101):

                    if a == 0 and b == 0:

                        break

                    if (100*A)*a + (100*B)*b + C*c + D*d > F:

                        break

                    if  ((100*A)*a + (100*B)*b)/100 *E < C*c + D*d:

                        break

                    density = 100 * (C*c+D*d) / ( (100*A)*a + (100*B)*b + C*c + D*d )

                    memo[a,b,c,d] = density

    

    max_v = max(memo.values())

    

    for k, v in list(memo.items()):

        if v == max_v:

            print(((100*A)*k[0] + (100*B)*k[1] + C*k[2] + D*k[3], C*k[2] + D*k[3] ))

            break

 

if __name__ == '__main__':

    solve()
def solve():

    

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

    memo = {}

    

    for a in range(31):

        for b in range(31):

            for c in range(101):

                for d in range(101):

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

                    s = C*c + D*d

                    if w ==0:

                        break

                    if w+s > F:

                        break

                    else:

                        if w/100 * E >= s:

                            density = 100* s/(w+s)

                            memo[a,b,c,d] = density

    

    max_v = max(memo.values())

    

    for k, v in list(memo.items()):

        if v == max_v:

            print(((100*A)*k[0] + (100*B)*k[1] + C*k[2] + D*k[3], C*k[2] + D*k[3] ))

            break

 

if __name__ == '__main__':

    solve()
def solve():
    A, B, C, D, E, F = list(map(int, input().split()))
    memo = {}
    for a in range(31):
        for b in range(31):
            for c in range(101):
                for d in range(101):
                    if a == 0 and b == 0:
                        break
                    if (100 * A) * a + (100 * B) * b + C * c + D * d > F:
                        break
                    if ((100 * A) * a + (100 * B) * b) / 100 * E < C * c + D * d:
                        break
                    density = (
                        100
                        * (C * c + D * d)
                        / ((100 * A) * a + (100 * B) * b + C * c + D * d)
                    )
                    memo[a, b, c, d] = density
    max_v = max(memo.values())
    for k, v in list(memo.items()):
        if v == max_v:
            print(
                (
                    (100 * A) * k[0] + (100 * B) * k[1] + C * k[2] + D * k[3],
                    C * k[2] + D * k[3],
                )
            )
            break


if __name__ == "__main__":
    solve()

def solve():
    A, B, C, D, E, F = list(map(int, input().split()))
    memo = {}
    for a in range(31):
        for b in range(31):
            for c in range(101):
                for d in range(101):
                    w = (100 * A) * a + (100 * B) * b
                    s = C * c + D * d
                    if w == 0:
                        break
                    if w + s > F:
                        break
                    else:
                        if w / 100 * E >= s:
                            density = 100 * s / (w + s)
                            memo[a, b, c, d] = density
    max_v = max(memo.values())
    for k, v in list(memo.items()):
        if v == max_v:
            print(
                (
                    (100 * A) * k[0] + (100 * B) * k[1] + C * k[2] + D * k[3],
                    C * k[2] + D * k[3],
                )
            )
            break


if __name__ == "__main__":
    solve()

-                    if a == 0 and b == 0: +                    w = (100 * A) * a + (100 * B) * b +                    s = C * c + D * d +                    if w == 0: -                    if (100 * A) * a + (100 * B) * b + C * c + D * d > F: +                    if w + s > F: -                    if ((100 * A) * a + (100 * B) * b) / 100 * E < C * c + D * d: -                        break -                    density = ( -                        100 -                        * (C * c + D * d) -                        / ((100 * A) * a + (100 * B) * b + C * c + D * d) -                    ) -                    memo[a, b, c, d] = density +                    else: +                        if w / 100 * E >= s: +                            density = 100 * s / (w + s) +                            memo[a, b, c, d] = density