import Data.List

main=do
    [a,b,c,d,e,f]<-map read.words<$>getLine::IO[Int]
    let (w,s) = maximumBy fc $ concatMap (\(e,w)-> map (\s->(w+s,s)) $ ss c d e) $ map (ee f e) $ ws f a b
    --
    print $ show w ++ " " ++ show s

ws f a b =[(aa*100*a+bb*100*b)|aa<-[0..f`div`(100*a)],bb<-[0..(f-100*aa*a)`div`(100*b)]]

ee f e w =(min ((w`div`100)*e) (f-w), w)
    
ss c d e = [(cc*c+dd*d)|cc<-[0..e`div`c], dd<-[0..(e-cc*c)`div`d]]

fc (w1,s1) (w2,s2) = compare (s1*w2) (s2*w1)