object Main extends App {
  val input = scala.io.StdIn.readLine().split(" ").map(_.toInt)
  val N = input(0)
  val total = input(1)

  for (x <- 0 to N; y <- 0 to N - x) {
    val z = N - x - y
    if (x * 10000 + y * 5000 + z * 1000 == total) {
      println(s"$x $y $z")
      sys.exit
    }
  }
  println(s"-1 -1 -1")
}
