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

    println {
      val r = 0 to n
      lazy val pats = for (i <- r; j <- r; k <- r;
            if i + j + k == n && 10000 * i + 5000 * j + 1000 * k == y)
        yield (i, j, k)
      (if (pats.isEmpty) (-1, -1, -1) else pats.head) match {
        case (i, j, k) => s"$i $j $k"
      }
    }
  }
}
