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



amax = F//(100*A)

bmax = F//(100*B)



concmx =0

wholemx =0

sugarmx =0



for a in range(amax,-1,-1):

    for b in range(bmax,-1,-1):

        cmax = (F-100*A*a-100*B*b)//C

        dmax = (F-100*A*a-100*B*b)//D

        for c in range(cmax,-1,-1):

            for d in range(dmax,-1,-1):

                sugar =C*c+D*d

                whole = 100*A*a+100*B*b+sugar

                if whole ==0:

                    break

                elif sugar/whole <= E/(100+E) and whole <=F:

                    if sugar/whole >= concmx:

                        concmx =sugar/whole

                        sugarmx = sugar

                        wholemx =whole

                    

                   

print((str(wholemx)+" "+str(sugarmx)))

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



amax = F//(100*A)

bmax = F//(100*B)



concmx =0

wholemx =0

sugarmx =0



for a in range(amax,-1,-1):

    bmax = (F-100*A*a)//B

    for b in range(bmax,-1,-1):

        cmax = (F-100*A*a-100*B*b)//C

        

        for c in range(cmax,-1,-1):

            dmax = (F-100*A*a-100*B*b-C*c)//D

            for d in range(dmax,-1,-1):

                sugar =C*c+D*d

                whole = 100*A*a+100*B*b+sugar

                if whole ==0:

                    break

                elif sugar/whole <= E/(100+E) and whole <=F:

                    if sugar/whole >= concmx:

                        concmx =sugar/whole

                        sugarmx = sugar

                        wholemx =whole

                    

                   

print((str(wholemx)+" "+str(sugarmx)))

                    
A, B, C, D, E, F = list(map(int, input().split()))
amax = F // (100 * A)
bmax = F // (100 * B)
concmx = 0
wholemx = 0
sugarmx = 0
for a in range(amax, -1, -1):
    for b in range(bmax, -1, -1):
        cmax = (F - 100 * A * a - 100 * B * b) // C
        dmax = (F - 100 * A * a - 100 * B * b) // D
        for c in range(cmax, -1, -1):
            for d in range(dmax, -1, -1):
                sugar = C * c + D * d
                whole = 100 * A * a + 100 * B * b + sugar
                if whole == 0:
                    break
                elif sugar / whole <= E / (100 + E) and whole <= F:
                    if sugar / whole >= concmx:
                        concmx = sugar / whole
                        sugarmx = sugar
                        wholemx = whole
print((str(wholemx) + " " + str(sugarmx)))

A, B, C, D, E, F = list(map(int, input().split()))
amax = F // (100 * A)
bmax = F // (100 * B)
concmx = 0
wholemx = 0
sugarmx = 0
for a in range(amax, -1, -1):
    bmax = (F - 100 * A * a) // B
    for b in range(bmax, -1, -1):
        cmax = (F - 100 * A * a - 100 * B * b) // C
        for c in range(cmax, -1, -1):
            dmax = (F - 100 * A * a - 100 * B * b - C * c) // D
            for d in range(dmax, -1, -1):
                sugar = C * c + D * d
                whole = 100 * A * a + 100 * B * b + sugar
                if whole == 0:
                    break
                elif sugar / whole <= E / (100 + E) and whole <= F:
                    if sugar / whole >= concmx:
                        concmx = sugar / whole
                        sugarmx = sugar
                        wholemx = whole
print((str(wholemx) + " " + str(sugarmx)))

+    bmax = (F - 100 * A * a) // B -        dmax = (F - 100 * A * a - 100 * B * b) // D +            dmax = (F - 100 * A * a - 100 * B * b - C * c) // D