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

    for(i in 0..n) {
        for(j in 0..n-i) {
            for(k in 0..n-i-j) {
                if(1000*i + 5000*j + 10000*k == y && i+j+k == n) {
                    println("$k $j $i")
                    return
                }
            }
        }
    }

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