import scala.io.{StdIn => in}

object Main extends App {
  val Array(n, yen) = in.readLine.split(" ").map(_.toInt)
  val ans = {
    var isFind = false
    var res = Array(0,0,0)
    for {
      x <- 0 to n
      y <- 0 to n - x
      if !isFind
    } {
      val z = n - x - y
      if((10000 * x) + (5000 * y) + (1000 * z) == yen) {
        res = Array(x, y, z)
        isFind = true
      }
    }
    if(res.forall(_ == 0)) Array(-1,-1,-1) else res
  }

  println(ans.mkString(" "))
}