import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Maybe

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [n, y] <- getIntList

  let solve a b | a == 0 && b == 0 = if y `div` 1000 == n then (0, 0, n) else (-1, -1, -1)
                | otherwise        =
                  let c = n - a - b
                      b' = if b == 0 then 2000 else b - 1
                      a' = if b == 0 then a - 1 else a
                  in if c >= 0 && 10000*a + 5000*b + 1000*c == y
                     then (a, b, c)
                     else solve a' b'

  putStrLn $ case solve 2000 0 of
    (a, b, c) -> show a ++ " " ++ show b ++ " " ++ show c