
fun main(arr:Array<String>) {
    val (n, y) = readLine()!!.split(" ").map { it.toInt() }
    getAns(n,y)
}

fun getAns(n:Int, y:Int) {
    if(n > y/1000 || n < y/10000) {
        println("-1 -1 -1")
        return
    }
    for(i in (0..y/10000).reversed()) {
        var remain = y - (i*10000)
        var current = remain / 1000
        var c5000 = 0
        while (current + c5000 + i >= n + 4 && current >= 5) {
            c5000++
            current -= 5
        }
        if(current + c5000 + i == n) {
            println("%d %d %d".format(i, c5000, current))
            return
        }
    }
    println("-1 -1 -1")
}