main = do 
  (x:y:xs) <- map read . words <$> getLine
  putStrLn . unwords . map show $ solve 0 0 0 x y


solve m s h x y
  | x == 0 && y == 0 = [m,s,h]
  | x <= 0 || y <= 0 = [-1,-1,-1]
  | otherwise = 
      let mr = solve (m+1) s h (x-1) (y-10000)
          sr = solve m (s+1) h (x-1) (y-5000)
          hr = solve m s (h+1) (x-1) (y-1000)
      in if h * x < y || m * x > y then
        [-1,-1,-1]
      else if head mr /= -1 then
        mr
      else if head sr /= -1 then
        sr
      else
        hr