import scala.util.control.Breaks

object Main {
  def main(args: Array[String]) = {
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val Y = sc.nextLong
    val b = new Breaks
    var flag = false
    b.breakable {
      for (i <- 0 to N)
        for (j <- 0 to N - i)
          for (k <- 0 to N - i - j)
            if (Y == 10000 * k + 5000 * j + 1000 * i && N == k + j + i) {
              flag = true
              println(k + " " + j + " " + i)
              b.break()
            }
    }
    if (!flag) println("-1 -1 -1")
  }
}