import scala.io.StdIn.readLine

object Main extends App {

  val (n, y) = readLine().split(" ") match {
    case Array(n, y) => (n.toInt, y.toLong)
  }
  val p = for {
    a <- (0 to n).view
    na = n - a
    b <- (0 to na).view
    c = na - b
    if 10000 * a + 5000 * b + 1000 * c == y
  } yield (a, b, c)

  val (a, b, c) = p.headOption.getOrElse((-1, -1, -1))
  println(s"$a $b $c")
}
