{-# LANGUAGE BangPatterns #-}

module Main where

import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf

check :: Int -> (Int, Int, Int) -> Maybe (Int, Int, Int)
check n (p, q, r) = iter (p, q, r)
  where
    iter :: (Int, Int, Int) -> Maybe (Int, Int, Int)
    iter (!a, !b, !c)
        | k >  n    = Nothing
        | a <  0    = Nothing
        | k == n    = Just (a, b, c)
        | v == 0    =
            if u <= b
                then Just (a, b - u, c + 5 * u)
                else iter (a - 1, b + 2, c)
        | otherwise = iter (a - 1, b + 2, c)
      where
        k = a + b + c
        (u, v) = (n - k) `divMod` 4

main :: IO ()
main = do
    [n, y] <- fmap read . words <$> getLine :: IO [Int]
    let (q1, r1) = y  `divMod` 10000
    let (q2, r2) = r1 `divMod` 5000
    let (q3, r3) = r2 `divMod` 1000
    let ans = check n (q1, q2, q3)
    case ans of
        Nothing        -> putStrLn "-1 -1 -1"
        Just (a, b, c) -> printf "%d %d %d\n" a b c