main :: IO ()
main = do
    [n, y] <- (map read) . words <$> getLine
    let combinations = [(a, b, n-a-b) | a <- [0..n], b <- [0..n-a], a*10000 + b*5000 + (n-a-b)*1000 == y]
    let (t1, t2, t3) = if null combinations then (-1, -1, -1)
                                            else head combinations
    putStr $ show t1 ++ " " ++ show t2 ++ " " ++ show t3 