import Data.List

type WS = (Double, Double, Double, Double)

main :: IO ()
main = do
    [a, b, c, d, e, f] <- map read . words <$> getLine :: IO [Double]
    let ce      = e / (100 + e)
    let pattern = [ (a*100*n, b*100*m, c*o, d*p) |  n <- [0..30] , m <- [0..30]
                                                  , o <- [0..100], p <- [0..100]
                                                  , a*n*100 + b*m*100 + c*o + d*p <= f ]
    putStrLn . unwords . map (show . truncate) . (\(w1, w2, s1, s2) -> [w1+w2+s1+s2, s1+s2]) $ hoge ce pattern (0, 0, 0, 0)

getNode :: Double -> WS -> Double
getNode ce (a, b, c, d)
    | ce >= (c+d) / (a+b+c+d) = (c+d) / (a+b+c+d)
    | otherwise               = 0

hoge :: Double -> [WS] -> WS -> WS
hoge ce [] best = best
hoge ce (x:xs) best
    | getNode ce x == ce             = x
    | getNode ce x > getNode ce best = hoge ce xs x
    | otherwise                      = hoge ce xs best