main = do
  [a,b,c,d,e,f] <- map read . words <$> getLine
  let (_,x,y) = maximum [((q+r)`divMod`(o+p),o+p,q+r) |
                  o <- [0,100*a..f],
                  p <- [0,100*b..f-o],
                  o+p /= 0,
                  let m = (f-o-p)`min`((o+p)*e`div`100), 
                  q <- [0,c..m],
                  let r = ((m-q)`div`d)*d]
  putStrLn $ show (x+y) ++ " " ++ show y