object Main {
  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val Y = sc.nextLong

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