object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val y = sc.nextInt() / 1000
  var a = -1
  var b = -1
  var c = -1

  for {
    i <- 0 to n
    j <- 0 to n-i
    if a == -1
  } {
    val k = n - i - j
    if (10 * i + 5 * j + k == y) {
      a = i
      b = j
      c = k
    }
  }

  println(s"$a $b $c")
}