import Data.List


main = do
  (a:b:c:d:e:f:_) <- getLine >>= return . map read . words :: IO [Int]

  let
    sugar = nub $ sort $ (takeWhile (<=f) (iterate (+c) c)) ++ (takeWhile (<=f) (iterate (+d) d))
    water = nub $ sort $ (takeWhile (<=f) (iterate (+(a*100)) (a*100))) ++ (takeWhile (<=f) (iterate (+(b*100)) (b*100)))

    (ws, s) = maximumBy (\(x1,y1) (x2,y2) -> compare (divint y1 x1) (divint y2 x2)) [(w+s,s) | w <- water, s <- sugar, w + s <= f, (div w 100) * e >= s]

  putStr $ show ws
  putStr " "
  putStrLn $ show s

  where
    divint a b = (fromIntegral a) / (fromIntegral b)
