import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B
import Debug.Trace 

main :: IO ()
main = readLine >>= printRes . solve 
    where
        printRes = putStrLn . unwords . map show 

solve :: [Int] -> [Int]
solve [a, b, c, d, e, f] = head . traceShowId $ sortBy (flip cmpf) cs
    where
        as = filter (\(x, y) -> 100 * (x * a + y * b) <= f) $ tail ((,) <$> [0..(f `div` (100 * a))] <*> [0..(f `div` (100 * b))])
        cs = [check x | x <- as]

        cmpf [la, lb] [ra, rb] = compare (100 * lb * (ra + rb)) (100 * rb * (la + lb))

        check (x, y) = [100 * (a * x + b * y) + s, s]
            where
                r = f - 100 * (a * x + b * y)
                m = min r $ (a * x + b * y) * e
                s = maximum . filter (<= m) . map (\(u, v) -> u * c + v * d) $ ((,) <$> [0..(m `div` c)] <*> [0..(m `div` d)])


readLine :: IO [Int]
readLine = unfoldr (\s -> second (maybe B.empty snd . B.uncons) <$> B.readInt s) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine