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

    for (a in 0..n) {
        for (b in 0..(n - a)) {
            val c = n - a - b
            if (calc(a, b, c) == y) {
                println("$a $b $c")
                return
            }
        }
    }
    println(Array(3) { -1 }.joinToString(" "))
}

fun calc(a: Int, b: Int, c: Int): Int = 10000 * a + 5000 * b + 1000 * c

