import scala.io.StdIn

object Main extends App {
  val in = StdIn.readLine.split(" ").map(_.toInt)
  val n = in(0).toInt
  val y = in(1).toInt / 1000
  val l10k = y / 10
  val l05k = y / 5

  val res =
    for{
      i <- 0 to l10k
      a10k = 10 * i
      j <- 0 to l05k
      rem = y - a10k - 5 * j
      if rem >= 0 && rem == n - i - j
    } yield (i, j, n-i-j)

  val ans = if(res.size == 0) (-1,-1,-1) else res(0)

  println(ans._1 + " " + ans._2 + " " + ans._3)
}