import java.util.Scanner

import scala.util.control.Breaks

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

  var ans = ""
  val b = new Breaks

  b.breakable {
    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) {
            ans = i + " " + j + " " + k
            b.break
          }
        }
      }
    }
  }
  if (ans == "") ans = "-1 -1 -1"
  println(ans)

}
