main = do
  [n, y] <- map read . words <$> getLine
  let ns = [[a, b, n - (a + b)] | a <- [0..n], b <- [0..(n - a)]]
  let nsy = filter (\[a, b, c] -> 10000 * a + 5000 * b + 1000 * c == y) ns
  putStrLn $ if null nsy then "-1 -1 -1" else unwords (map show (head nsy))