fun main(arg: Array<String>) {
    val (N, Y) = listOfInt()
    val M = IntArray(3)
    for (i in 0 .. N)
        for (j in 0 .. N) {
            val k = N - i - j
            if (k < 0) break
            val t = i * 10000 + j * 5000 + k * 1000
            if (t == Y) return println("$i $j $k")
        }
    println("-1 -1 -1")
}

fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map { Integer.parseInt(it) }
