import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val yy = sc.nextInt()

  for (zi in 0..n) {
    for (yi in 0..n-zi) {
      val xi = n - zi - yi
      if (xi * 10000 + yi * 5000 + zi * 1000 == yy) {
        val ans = arrayOf(xi, yi, zi)
        println(ans.joinToString(" "))
        return
      }
    }
  }

  println("-1 -1 -1")
}
