import qualified Data.ByteString.Char8 as C
import Data.Maybe ( fromJust )

import Data.Ratio
import Data.List (maximumBy)

getParms :: IO [Int]
getParms = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

main :: IO ()
main = do
  as@[a,b,c,d,e,f] <- getParms
  let (w,s) = maxWS as
  putStrLn $ show w ++ " " ++ show s

type SW = Int -- SugarWater
type S  = Int -- Sugar

percentage :: (SW, S) -> Ratio Int
percentage (a,b) = b % a 

total :: (SW,S) -> Int
total = fst

combinations :: [Int] -> [(SW,S)]
combinations [a,b,c,d,_e,f] 
  = [(100*a*na + 100*b*nb + c*nc + d*nd, c*nc + d*nd)
      | let fa = f `div` (100*a)
      , na <- [0 .. fa]
      , let fb = (f-100*a*na) `div` (100*b)
      , nb <- [0 .. fb]
      , let fc = (f-100*(a*na + b*nb)) `div` c
      , nc <- [0 .. fc]
      , let fd = (f-100*(a*na + b*nb)-c*nc) `div` d
      , nd <- [0 .. fd]
      ]

maxWS as@[a,b,c,d,e,f] = solve e a' as'
  where 
    (a':as') = combinations as

solve :: Int -> (SW,S) -> [(SW,S)] -> (SW,S)
solve _ best []     = best
solve e best (a:as)
  | percentage a == e' = a
  | e' < a'            = solve e a as
  where
    e' = percentage (e+100, e)
    a' = percentage a
