import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val N = sc.nextInt()
  val Y = sc.nextInt()

  var hasAns = false
  for (i <- 0 to N) {
    for (j <- 0 to N-i) {
      for (k <-  0 to N-i-j) {
        if  (i*10000 + j*5000 + k*1000 == Y && i+j+k == N) {
          println(i + " " + j + " " + k)
          hasAns = true
        }
      }
    }
  }
  if (!hasAns) println("-1 -1 -1")

}
