import scala.io.StdIn.readLine

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

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

}
