module Main where

import Control.Applicative
import Control.Monad
import Data.List
import Data.Ratio
import Text.Printf

main :: IO ()
main = do
    [a, b, c, d, e, f] <- fmap read . words <$> getLine :: IO [Int]
    let water = do
            i <- [0 .. f `div` (100 * a)]
            j <- [0 .. f `div` (100 * b)]
            let g = 100 * a * i + 100 * b * j
            guard (0 < g && g <= f)
            return g
    let sugar = do
            i <- [0 .. f `div` c]
            j <- [0 .. f `div` d]
            let g = c * i + d * j
            guard (g <= f)
            return g
    let f1 [w, s] = (w + s <= f) && (s <= (w `div` 100) * e)
    let g1 [w1, s1] [w2, s2] = (s1 % w1) `compare` (s2 % w2)
    let [aw, as] = maximumBy g1 . filter f1 $ sequence [water, sugar]
    printf "%d %d\n" (aw + as) as