import Control.Monad
import Control.Applicative
import Data.List
import Data.Array
strToInt s = (read :: String -> Int) s
f (a,_,_) = a
s (_,b,_) = b
t (_,_,c) = c

main = do
   [n,y] <- (map strToInt . words) <$> getLine
   let ansset = [(a,b,n-a-b) | a<-[0..n],b<-[0..n],a+b<=n,10000*a + 5000*b + 1000*(n-a-b) == y]
   
   if (null ansset) == True
   then putStrLn "-1 -1 -1"
   else putStrLn (show (f (head ansset)) ++" " ++ show (s (head ansset)) ++ " " ++ show (t (head ansset)) )
