import Data.List

main = do
  bk <- map read . words <$> getLine
  printBk . getOpt $ solve bk
 
solve bk = [(0, 0)]
  >>= op a 0 e f
  >>= op b 0 e f
  >>= op 0 c e f
  >>= op 0 d e f
    where [a, b, c, d, e, f] = bk
 
op x y e f (w, s) = takeWhile p $ iterate g (w, s)
  where
    p (w, s) = w + s <= f 
        && s * (100 + e) <= e * (w + s)
    g (w, s) = (w + x, s + y)
 
getOpt bks = head . sortBy q
  where 
    q (w, s) (u, t) = compare (t * (w + s)) (s * (u + t))
 
printBk (w, s) = do
  putStr . show $ w + s
  putStr " "
  print s