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