{-# OPTIONS_GHC -O #-}

import Control.Monad
import Data.List

main=do
    [n,y] <- map read.words<$>getLine ::IO[Int]
    putStrLn $ case  [(a,b) | a<-[0..n], b<-[0..n-a], 1000*a+5000*b+10000*(n-a-b) == y] of
        [] -> "-1 -1 -1"
        ((a,b):_) -> show (n-a-b) ++" "++show b++" "++show a