module Main(main) where
import Data.List

comb n y = filter (\(a,b,c) -> y == (a*10) + (b*5) + c) $ [0 .. n] >>= (\y -> map (\a -> (a,y,n-y-a)) [0 .. n-y])
  
ans [] = "-1 -1 -1"
ans ((a,b,c):_) = (show (floor a)) ++ " " ++ (show (floor b)) ++ " " ++ (show (floor c))

main :: IO ()
main = do
  [n,y] <- map read . words <$> getLine :: IO [Double]
  putStrLn $ ans $ comb n (y / 1000)

