import Data.List
 
main = do
  [a, b, c, d, e, f] <- map read . words <$> getLine
  let xs = concat $ unfoldr (op1 a f) <$> [(0, 0)]
  let ys = concat $ unfoldr (op1 b f) <$> xs
  let zs = concat $ unfoldr (op2 c e f) <$> ys
  let ws = concat $ unfoldr (op2 d e f) <$> zs
  printbk $ g 0 ws
 
op1 :: Int -> Int -> (Int, Int) -> Maybe ((Int, Int), (Int, Int))
op1 a f (w, s)
  | w + s > f = Nothing
  | otherwise = Just (u, u)
  where u = (w + 100 * a, s)
 
op2 :: Int -> Int -> Int -> (Int, Int) -> Maybe ((Int, Int), (Int, Int))
op2 c e f (w, s)
  | w + s > f = Nothing
  | s * (100 + e) > e * (w + s) = Nothing
  | otherwise = Just (u, u)
  where u = (w, s + c)
  
g x [] = x
g (u, t) x ((w, s):xs)
  | s * (u + t) > t * (w + s) = (w, s)
  | otherwise = (u, t)

printbk (w, s) = do
  putStr $ show (w + s)
  putStr " "
  putStr $ show s