import Data.List (notNull)

main :: IO ()
main = do
	[n, y] <- map read . words <$> getLine
    let sets = [(a, b, c) | a <- [1..n], b <- [1..(n-a)], c <- [1..(n-b-a)]]
        sets' = filter (\(a, b, c) -> a * 10000 + b * 5000 + c * 1000 == y)
    print $ if notNull sets' then head $ map (\(a, b, c) -> show a <> " " <> show b <> show c) sets'
                             else "-1 -1 -1"