{-
     9 * a + 5 * b =  10 * N - Y
         a +     b <= N

-}

main = do
    input <- fmap words getLine
    let (n, y) = (read $ head input, (read $ input!!1))
    let pairs = [(a, b) | a <- [0..n], b <- [0..n], a + b <= n]
    let satisfiesEquation = filter (\(a ,b) -> 9000 * a + 5000 * b == 10000 * n - y) pairs
    if length satisfiesEquation /= 0 then
        do
            let (t, f) = head satisfiesEquation
            let (thousand, fiveThousand) = (round t, round f)
            putStr $ show $ (round $ n - t - f)
            putStr " "
            putStr $ show  fiveThousand
            putStr " "
            putStrLn $ show thousand
    else
        putStrLn "-1 -1 -1"
