import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc = new Scanner(System.in)
    val Array(n, y) = sc.nextLine.split(" ").map(_.toInt)

    var comb = List[(Int, Int, Int)]()
    val max10000 = y / 10000

    for (i <- 0 to Array(max10000, n).min)
      for (j <- 0 to Array(Array((y - 10000 * i) / 5000, n - i).min, 0).max)
        comb = (i, j, n - i - j) :: comb

    val candidatesCombinations = comb.dropWhile(item => 10000 * item._1 + 5000 * item._2 + 1000 * item._3 != y)
    if (candidatesCombinations.isEmpty) println("-1 -1 -1")
    else {
      val ans = candidatesCombinations.head
      println(ans._1.toString + " " + ans._2.toString + " " + ans._3.toString)
    }
  }
}
