fun main(args: Array<String>) {
    val l = readLine()!!.split(' ').map { it.toInt() }
    val n = l[0]
    var x = l[1]/1000 - n
    for (a in 0..n) {
        for (b in 0..(n-a)) {
            if (9*a+4*b == x) {
                println("$a $b ${n-a-b}")
                return
            }
        }
    }
    println("-1 -1 -1")
}
