import scala.io.StdIn
object Main extends App {
  val input = StdIn.readLine()
  val N = input.split(" ")(0).toInt
  val Y = input.split(" ")(1).toInt
  val answers = for {
    x <- 0 to N
    y <- 0 to (N - x)
    if (10000 * x + 5000 * y + 1000 * (N - x - y) == Y)
  } yield List(x, y, N - x -y)
  if (answers.isEmpty) println("-1 -1 -1") else println(answers(0).mkString(" "))
}
