import scala.util.control.Breaks

object Main{
  def main(args: Array[String]) {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val y = sc.nextInt

    var flag = true
    val b = new Breaks
    b.breakable {
      for (i <- 0 to n) {
        for (j <- 0 to (n - i)) {
          if (i * 10000 + j * 5000 + (n - i - j) * 1000 == y) {
            println(s"$i $j ${n - i - j}")
            flag = false
            b.break
          }
        }
      }
    }
    if (flag)
      println("-1 -1 -1")
  }
}