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