import Data.List
import qualified Data.IntSet as IS
main=putStrLn.solve.map read.words=<<getLine
solve[a,b,c,d,e,f]=unwords$map show[w+s,s]where
  (w,s)=maximumBy(\(w1,s1)(w2,s2)->compare(w2*s1)(w1*s2))sws
  sws=map h$g a b$f`div`100
  ss=IS.fromList$g c d$f*e`div`100
  h w=(w*100,s)where Just(s)=IS.lookupLE(min(w*e)(f-w*100))ss
g x y z=[v|x<-xs,y<-ys,let v=x+y,x+y<z]
  where[xs,ys]=map(\x->map(*x)[0..z`div`x])[x,y]