import Data.Int (Int64)

findCand :: Integral a => a -> a -> Maybe (a, a, a)
findCand n y
    | null cands = Nothing
    | otherwise = Just $ head cands
    where
        y0 = div y 1000
        cands = [(a, b, c) | a <- [0 .. n], b <- [0 .. n],
                             let c = n - a - b, c >= 0,
                             10 * a + 5 * b + c == y0]

main :: IO ()
main = do
    [n, y] <- fmap read . words <$> getLine :: IO [Int64]
    let res = case findCand n y of
                Just (a, b, c) -> [a, b, c]
                Nothing -> [-1, -1, -1]
    putStrLn $ unwords $ fmap show res
