import Data.List
import Control.Monad
import Data.Maybe

main = do
  [n, y] <- map read . words <$> getLine :: IO [Int]
  
  putStrLn . (\(a,b,c)-> show a++" "++show b++" "++show c) . head . catMaybes $ flip map [(a, b, n-(a+b))|a<-[0..n], b<-[0..n-a]] (\(a, b, c) ->
    if 10000*a + 5000*b + 1000*c == y 
        then Just (a, b, c) 
        else Nothing) ++ [Just (-1, -1, -1)]
