import Data.List

main = do
  [n,y] <- map read . words <$> getLine :: IO [Int]
  let patten = [(i, j) | i <- [0..n], j <- [0..n-i]]
      ans = map (solve n y) patten
      flag = or ans
  if flag
    then let idx = head $ elemIndices True ans
             (a, b) = patten !! idx
         in putStrLn $ show a ++ " " ++ show b ++ " " ++ show (n-a-b)
    else putStrLn "-1 -1 -1"

solve :: Int -> Int -> (Int, Int) -> Bool
solve n y (i,j)
  | i * 10000 + j * 5000 + (n-i-j) * 1000 == y = True
  | otherwise = False
