main :: IO ()
main = do
    [n, yen] <- map read . words <$> getLine
    let ans =
            [ [x, y, n - x - y]
            | x <- [0 .. n]
            , y <- [0 .. n - x]
            , 10000 * x + 5000 * y + 1000 * (n - x - y) == yen
            ]
    putStrLn . unwords . map show $ if null ans then [-1, -1, -1] else head ans
