def main():

    A, B, C, D, E, F = (int(i) for i in input().split())



    water = set()

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

        for b in range(0,F+1,100*B):

            if a + b != 0 and a+b <= F:

                water.add(a+b)



    max_consist = 0

    ans = (0,0)

    for w in water:

        ab = w //100

        sugar_max = E * ab

        x = sugar_max // C

        y = sugar_max // D

        s = max(C*i + D*j for i in range(x+1) for j in range(y+1) if C*i + D*j <= sugar_max and w + C*i + D*j <= F)

        if w + s <= F:

            cur_consist = (100*s)/(w+s)

            if max_consist <= cur_consist:

                max_consist = cur_consist

                ans = (w + s,s)



    print((*ans))

if __name__ == '__main__':

    main()
#提出 #6036238 参考

def main():

    A, B, C, D, E, F = (int(i) for i in input().split())



    WF = F//100

    water = [False] * (WF + 1)

    water[0] = True

    #30

    for n in range(WF + 1):

        if water[n]:

            if n+A <= WF: water[n+A] = True

            if n+B <= WF: water[n+B] = True



    sugar = [False] * (F + 1)

    sugar[0] = True

    #3000

    for n in range(F + 1):

        if sugar[n]:

            if n+C <= F: sugar[n+C] = True

            if n+D <= F: sugar[n+D] = True



    water = set(100*x for x in range(1,1+WF) if water[x]) #0除算を避け、かつ水の量0はありえないのでrange(1,1+WF)

    sugar = set(x for x in range(1+F) if sugar[x]) #砂糖0gでも、濃度0%の砂糖水



    max_consist = -1

    ans = (0,0)

    #at most 30*3000 

    for w in water:

        for s in sugar:

            if s <= w//100 * E and w + s <= F: #sがwに溶け残らない、かつwとsがビーカーに入り切る

                cur_consist = (100*s)/(w+s)

                if max_consist < cur_consist:

                    max_consist = cur_consist

                    ans = (w + s,s)



    print((*ans))

if __name__ == '__main__':

    main()
def main():
    A, B, C, D, E, F = (int(i) for i in input().split())
    water = set()
    for a in range(0, F + 1, 100 * A):
        for b in range(0, F + 1, 100 * B):
            if a + b != 0 and a + b <= F:
                water.add(a + b)
    max_consist = 0
    ans = (0, 0)
    for w in water:
        ab = w // 100
        sugar_max = E * ab
        x = sugar_max // C
        y = sugar_max // D
        s = max(
            C * i + D * j
            for i in range(x + 1)
            for j in range(y + 1)
            if C * i + D * j <= sugar_max and w + C * i + D * j <= F
        )
        if w + s <= F:
            cur_consist = (100 * s) / (w + s)
            if max_consist <= cur_consist:
                max_consist = cur_consist
                ans = (w + s, s)
    print((*ans))


if __name__ == "__main__":
    main()

# 提出 #6036238 参考
def main():
    A, B, C, D, E, F = (int(i) for i in input().split())
    WF = F // 100
    water = [False] * (WF + 1)
    water[0] = True
    # 30
    for n in range(WF + 1):
        if water[n]:
            if n + A <= WF:
                water[n + A] = True
            if n + B <= WF:
                water[n + B] = True
    sugar = [False] * (F + 1)
    sugar[0] = True
    # 3000
    for n in range(F + 1):
        if sugar[n]:
            if n + C <= F:
                sugar[n + C] = True
            if n + D <= F:
                sugar[n + D] = True
    water = set(
        100 * x for x in range(1, 1 + WF) if water[x]
    )  # 0除算を避け、かつ水の量0はありえないのでrange(1,1+WF)
    sugar = set(x for x in range(1 + F) if sugar[x])  # 砂糖0gでも、濃度0%の砂糖水
    max_consist = -1
    ans = (0, 0)
    # at most 30*3000
    for w in water:
        for s in sugar:
            if s <= w // 100 * E and w + s <= F:  # sがwに溶け残らない、かつwとsがビーカーに入り切る
                cur_consist = (100 * s) / (w + s)
                if max_consist < cur_consist:
                    max_consist = cur_consist
                    ans = (w + s, s)
    print((*ans))


if __name__ == "__main__":
    main()

+# 提出 #6036238 参考 -    water = set() -    for a in range(0, F + 1, 100 * A): -        for b in range(0, F + 1, 100 * B): -            if a + b != 0 and a + b <= F: -                water.add(a + b) -    max_consist = 0 +    WF = F // 100 +    water = [False] * (WF + 1) +    water[0] = True +    # 30 +    for n in range(WF + 1): +        if water[n]: +            if n + A <= WF: +                water[n + A] = True +            if n + B <= WF: +                water[n + B] = True +    sugar = [False] * (F + 1) +    sugar[0] = True +    # 3000 +    for n in range(F + 1): +        if sugar[n]: +            if n + C <= F: +                sugar[n + C] = True +            if n + D <= F: +                sugar[n + D] = True +    water = set( +        100 * x for x in range(1, 1 + WF) if water[x] +    )  # 0除算を避け、かつ水の量0はありえないのでrange(1,1+WF) +    sugar = set(x for x in range(1 + F) if sugar[x])  # 砂糖0gでも、濃度0%の砂糖水 +    max_consist = -1 +    # at most 30*3000 -        ab = w // 100 -        sugar_max = E * ab -        x = sugar_max // C -        y = sugar_max // D -        s = max( -            C * i + D * j -            for i in range(x + 1) -            for j in range(y + 1) -            if C * i + D * j <= sugar_max and w + C * i + D * j <= F -        ) -        if w + s <= F: -            cur_consist = (100 * s) / (w + s) -            if max_consist <= cur_consist: -                max_consist = cur_consist -                ans = (w + s, s) +        for s in sugar: +            if s <= w // 100 * E and w + s <= F:  # sがwに溶け残らない、かつwとsがビーカーに入り切る +                cur_consist = (100 * s) / (w + s) +                if max_consist < cur_consist: +                    max_consist = cur_consist +                    ans = (w + s, s)