import Data.List
main = interact $ unwords . map show . sol . map read . words
sol [a,b,c,d,e,f] = snd $ minimum 
  [(fromIntegral (w+s)/fromIntegral s,[w+s,s]) |
  n <- [0,a..30], m <- [0,b..30], let w = 100*(n+m), w>0, w<=f,
  let g = min (f-w) (e*w`div`100+1), p <- [0,c..g], q <- [0,d..g], 
  let s = p+q, 100*s<=w*e, s+w<=f]