fun main(args: Array<String>) {
    val (n, y) = readLine()!!.split(' ').map { it.toInt() }
    solve(n, y).ans()
}

private fun solve(n: Int, y: Int): Triple<Int, Int, Int> {
    for (i in (0..n)) {
        for (j in (0..n - i)) {
            val k = n - i - j
            if (10000 * i + 5000 * j + 1000 * k == y) {
                return Triple(i, j, k)
            }
        }
    }

    return Triple(-1, -1, -1)
}

private fun Triple<Int, Int, Int>.ans() {
    println("${this.first} ${this.second} ${this.third}")
}
