import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    [n, y] <- getIntList
    putStrLn . head $ [show i ++ " " ++ show j ++ " " ++ show k| i <- [0..n], j <- [0..(n-i)], let k = n-i-j, i * 10000 + j * 5000 + k * 1000 == y] ++ ["-1 -1 -1"]