import scala.io.StdIn

object Main {
   def main(args: Array[String]) = {
      val Array(n, ty) = StdIn.readLine().split(' ').map(_.toLong)
      val y = ty / 1000
      // 10 5 1
      var t = -1L
      var f = 0L
      var ng = true
      //println("y:" + y)
      while (t <= n && ng) {
         t += 1
         f = n - t
         while (f >= 0 && ng) {
            val r = y - (t * 10 + f * 5)
            //println("r:" + r)
            //println("a:" + (n - (t + f)))
            if (0 <= r && r == n - (t + f)) {
               ng = false
            } else {
               f -= 1
            }
         }
      }
      val result = if (ng) (-1, -1, -1) else (t, f, n - t - f)
      println(result._1 + " " + result._2 + " " + result._3)
   }
}