import Control.Applicative
import Control.Monad

solver :: Integer -> Integer -> [Integer]
solver n y =
    let xs = [[a, b, c] | a <- [0..n], b <- [0..(n-a)], c <- [0..(n-a-b)], 10000*a+5000*b+1000*c == y]
        in if length xs > 0 then head xs else [-1, -1, -1]

main :: IO ()
main = do
    (n:y:_) <- (map read) . words <$> getLine
    putStrLn (unwords (map show (solver n y)))
