
fun main(args : Array<String>) {
    val (N, Y) = readLine()!!.split(" ").map { it.toInt() }
    (0..N).forEach { a->
        (0..N).forEach { b ->
            val c = N - (a + b)
            if (c >= 0 && a + b + c == N && 10000 * a + 5000 * b + 1000 * c ==  Y) {
                println(a.toString() + " " + b.toString() + " " + c.toString())
                return
            }
        }
    }
    println("-1 -1 -1")
}
