fun main(args: Array<String>) {
    val (N, Y) = readLine()!!.split(" ").map { it.toLong() }
    for (x in 0..N) {
        for (y in 0..(N - x)) {
            if (10000 * x + 5000 * y + 1000 * (N - x - y) == Y) {
                println("$x $y ${N - x - y}")
                System.exit(0)
            }
        }
    }
    println("-1 -1 -1")
}
