def main():

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

    a *= 100

    b *= 100

    m = (-1, 0, 0)

    for i in range(f // a + 1):

        for j in range((f - (a * i)) // b + 1):

            ma = a * i + b * j

            if ma == 0:

                continue

            for k in range((f - ma) // c + 1):

                if 100 * c * k > ma * e:

                    break

                for l in range((f - (ma + c * k)) // d + 1):

                    mb = c * k + d * l

                    if 100 * mb > ma * e:

                        break

                    dab = mb / (ma + mb)

                    if dab > m[0]:

                        m = (dab, ma + mb, mb)

    print((m[1], m[2]))





if __name__ == '__main__':

    main()

def main():

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

    x, y = set(), set()

    for i in range(f // (100 * a) + 1):

        for j in range((f - 100 * a * i) // (100 * b) + 1):

            x.add(100 * a * i + 100 * b * j)

    for i in range(f // c + 1):

        for j in range((f - c * i) // d + 1):

            y.add(c * i + d * j)

    m = (-1, -1, -1)

    for xi in x:

        for yi in y:

            if xi == 0:

                continue

            if xi + yi > f:

                continue

            if 100 * yi > xi * e:

                continue

            s = yi / (xi + yi)

            if s > m[0]:

                m = (s, xi + yi, yi)

    print((m[1], m[2]))





if __name__ == '__main__':

    main()
def main():
    a, b, c, d, e, f = list(map(int, input().split()))
    a *= 100
    b *= 100
    m = (-1, 0, 0)
    for i in range(f // a + 1):
        for j in range((f - (a * i)) // b + 1):
            ma = a * i + b * j
            if ma == 0:
                continue
            for k in range((f - ma) // c + 1):
                if 100 * c * k > ma * e:
                    break
                for l in range((f - (ma + c * k)) // d + 1):
                    mb = c * k + d * l
                    if 100 * mb > ma * e:
                        break
                    dab = mb / (ma + mb)
                    if dab > m[0]:
                        m = (dab, ma + mb, mb)
    print((m[1], m[2]))


if __name__ == "__main__":
    main()

def main():
    a, b, c, d, e, f = list(map(int, input().split()))
    x, y = set(), set()
    for i in range(f // (100 * a) + 1):
        for j in range((f - 100 * a * i) // (100 * b) + 1):
            x.add(100 * a * i + 100 * b * j)
    for i in range(f // c + 1):
        for j in range((f - c * i) // d + 1):
            y.add(c * i + d * j)
    m = (-1, -1, -1)
    for xi in x:
        for yi in y:
            if xi == 0:
                continue
            if xi + yi > f:
                continue
            if 100 * yi > xi * e:
                continue
            s = yi / (xi + yi)
            if s > m[0]:
                m = (s, xi + yi, yi)
    print((m[1], m[2]))


if __name__ == "__main__":
    main()

-    a *= 100 -    b *= 100 -    m = (-1, 0, 0) -    for i in range(f // a + 1): -        for j in range((f - (a * i)) // b + 1): -            ma = a * i + b * j -            if ma == 0: +    x, y = set(), set() +    for i in range(f // (100 * a) + 1): +        for j in range((f - 100 * a * i) // (100 * b) + 1): +            x.add(100 * a * i + 100 * b * j) +    for i in range(f // c + 1): +        for j in range((f - c * i) // d + 1): +            y.add(c * i + d * j) +    m = (-1, -1, -1) +    for xi in x: +        for yi in y: +            if xi == 0: -            for k in range((f - ma) // c + 1): -                if 100 * c * k > ma * e: -                    break -                for l in range((f - (ma + c * k)) // d + 1): -                    mb = c * k + d * l -                    if 100 * mb > ma * e: -                        break -                    dab = mb / (ma + mb) -                    if dab > m[0]: -                        m = (dab, ma + mb, mb) +            if xi + yi > f: +                continue +            if 100 * yi > xi * e: +                continue +            s = yi / (xi + yi) +            if s > m[0]: +                m = (s, xi + yi, yi)