import Control.Arrow
import Data.Function
import Data.List
import Data.Ratio

type State = (Int, Int) -- Water, Suger

-- NOT an answer and is a dirty brute force,
-- which eats up your memory,  but it's a good example of
-- unfoldr so I'll submit anyway
solve :: Int -> Int -> Int -> Int -> Int -> Int -> State
solve a b c d e f = bestOf $ unfoldr next [(0,0)]
    where
        operations :: [State -> State]
        operations = [first (+ a), first (+b), second (+c), second (+d)  ]
        next :: [State] -> Maybe (State, [State])
        next ss = case concatMap try ss of
                       [] -> Nothing
                       ns -> Just (bestOf ns,  ns)
        bestOf :: [State] -> State
        bestOf =
            maximumBy ( compare `on` (\(w,s) -> s % (s+w)))
        try :: State -> [State]
        try s  = filter ((&&) <$> containable <*> soluble) $ map ($ s) operations
        containable :: State -> Bool
        containable (w,s) = w+s <= f
        soluble :: State -> Bool
        soluble (w,s) = 100 * s <= e * w

report :: State -> IO ()
report (w,s) = do
    print $ w + s
    print s

main = do
    [a,b,c,d,e,f] <- map read . words <$> getLine
    report $ solve (100*a) (100*b) c d e f