import scala.io.StdIn.readLine

object Main extends App {
  val Array(n, y) = readLine.split(" ").map(_.toInt)

  for (a <- 0 to n; b <- 0 to n - a) {
    val c = n - a - b

    val t = 1000 * a
    val f = 5000 * b
    val m = 10000 * c
    if (t + f + m == y && a + b + c == n) {
      println(s"$c $b $a");
      sys.exit()
    }
  }
  println("-1 -1 -1")

}
