main = do
  [a,b,c,d,e,f] <- map read . words <$> getLine :: IO [Int]
  let ws = [(x,y) | x<-[0..f`div`(100*a)], y<-[0..f`div`(100*b)], let sum = 100*(a*x+b*y), sum <= f] 
  let as = [(water,sugar) | 
            (wa,wb)<-ws, 
            let slim = (a*wa+b*wb)*e, 
            x<-[0..slim`div`c], 
            y<-[0..slim`div`d], 
            let water = 100*(wa*a+wb*b),
            let sugar = c*x+d*y,
            sugar <= slim,
            water+sugar <= f]
  let (w,s) =  foldl (\(w1,s1) (w2,s2) -> if dent (w2,s2) > dent (w1,s1) then (w2,s2) else (w1,s1)) (0,0) as
  putStrLn $ show (w+s) ++ " " ++ show s
  
dent :: (Int,Int) -> Double
dent (_,0) = 0
dent (0,_) = 0
dent (w,s) = fromIntegral (s*100) / fromIntegral (s+w)