fun main(args: Array<String>) {
    abc085c()
}

fun abc085c() {
    val (n, y) = readLine()!!.split(" ").map { it.toInt() }

    for (y10000 in 0..n) {
        for (y5000 in 0..n - y10000) {
            val y1000 = n - y5000 - y10000
            if (y10000 * 10000 + y5000 * 5000 + y1000 * 1000 == y) return println("$y10000 $y5000 $y1000")
        }
    }

    println("-1 -1 -1")
}
