main = do
  [a,b,sc,sd,dis,lim] <- map read . words <$> getLine :: IO [Int]
  let (sa, compa) = comp a sc sd dis lim
  let (sb, compb) = comp b sc sd dis lim
  putStrLn $ 
    if (rsl sa compa) > (rsl sb compb)
     then show compa ++ " " ++ show sa
     else show compb ++ " " ++ show sb

rsl :: Int -> Int -> Int
rsl s comp = s*100 `div` comp 

comp :: Int -> Int -> Int -> Int -> Int -> (Int,Int)
comp w sc sd dis lim =
  let 
    r = lim - w*100
    s = sugar sc sd (min (dis*w) r)
  in
    (s, (w*100+s))
  where
    sugar :: Int -> Int -> Int -> Int
    sugar sc sd limit =
      maximum $ [sum | x<-[0..limit`div`sc], y<-[0..limit`div`sd], let sum = sc*x+sd*y, sum <= limit]

