import Data.List
import Data.Maybe

main = do
  [a,b,c,d,e,f] <- map read . words <$> getLine :: IO [Double]
  let index = [(aa, bb, cc, dd) | aa <- [0,a*100..f], bb <- [0,b*100..f], aa + bb <= f, let sugar = f - (aa + bb), cc <- [0,c..sugar], dd <- [0,d..sugar], cc + dd <= sugar]
      sugarWater = map (mix e) index
      max = maximum sugarWater
      maxIndex = fromJust $ elemIndex max sugarWater
  putStrLn . unwords . map (show . truncate) . (\(x, y, z, w) -> [x+y+z+w, z+w]) $ index !! maxIndex

mix :: Double -> (Double, Double, Double, Double) -> Double
mix e (a, b, c, d)
  | e / (100 + e) >= (c + d) / (a + b + c + d) = (c + d) / (a + b + c + d)
  | otherwise = -1
