import Data.List

solve a b c d e f =
  let
    (_,x,y) = maximum [(10000*s`div`(w+s),w+s,s)|t<-[i|i<-[0..f],i`mod`(a*100)==0],w<-[i|i<-[t..f],(i-t)`mod`(b*100)==0,i>0],m<-[min (f-w) (w*e`div`100)],u<-[i|i<-[0..m],i`mod`c==0],s<-[i|i<-[u..m],(i-u)`mod`d==0]]
  in
    intercalate " " $ map show [x,y]

main = do
  [a,b,c,d,e,f] <- map read . words <$> getLine
  putStrLn $ solve a b c d e f