import Control.Monad
main = do
  [n, y] <- (map read . words) <$> getLine
  putStrLn $ unwords $ map show $ resolve n y

co [] = [-1, -1, -1]
co (w:_) = w

resolve:: Int -> Int -> [Int]
resolve n y = w
  where
    w = co [[m, g, s] | m <- [0..n], g <- [0..(n - m)], s <- [n - m - g], m + g + s == n, m * 10000 + g * 5000 + s * 1000 == y]
