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 ans = (-1, -1, -1)
    breakable {
      val r = 0 to n
      for (i <- r; j <- r; k <- r;
           if i + j + k == n && 10000 * i + 5000 * j + 1000 * k == y) {
        ans = (i, j, k)
        break
      }
    }
    println(ans match {case (i, j, k) => s"$i $j $k"})
  }
}
