main = do
    xs <- fmap (map read . words) getLine :: IO [Int]
    putStrLn $ h' $ g' xs

h' (a, b) = unwords [show (a + b), show b]
g' [a, b, c, d, e, f] = foldl (\(mx, my) (x, y) -> if (mx + my) * y >= (x + y) * my then (x, y) else (mx, my)) (0, 0) $
    filter (\(x, y) -> 100 * y <= e * x)
        [(x, y) |
          x <- [1 .. f],
          y <- [1 .. f],
          x + y <= f,
          x `mod` (100 * a) == 0 || x `mod` (100 * b) == 0,
          y `mod` c == 0 || y `mod` d == 0]
