object Main {

  def main(args: Array[String]): Unit = {
    import scala.io.StdIn._

    // 10000, 5000円は 1000円札で表現できるので、
    // a枚, b枚, (N - a - b)枚 で計 Y円
    // 各最大枚数は, 10000 が Y / 10000 枚,
    // 5000 円 が
    // a枚, b枚

    val Array(n, y) = readLine().split(" ").map(_.toInt)
    val maxA = y / 10000
    val results = for {
      a <- 0 to maxA
      restA = y - (10000 * a)
      maxB = restA / 5000
      b <- 0 to maxB
      restB = restA - (5000 * b)
      c = n - a - b
      if (restB - (1000 * c)) == 0
    } yield (a, b, c)

    if (results.isEmpty)
      println("-1 -1 -1")
    else
      println(results.head._1 + " " + results.head._2 + " " + results.head._3)
  }

}