import java.util.*

fun main(args: Array<String>) {
    Scanner(System.`in`).use { sc ->
        val n = sc.nextInt()
        val y = sc.nextInt()

        for (ai in 0..n) {
            for (bi in 0..(n - ai)) {
                val ci = n - ai - bi
                if (ai * 10000 + bi * 5000 + ci * 1000 == y) {
                    println("$ai $bi $ci")
                    return
                }
            }
        }
        println("-1 -1 -1")
    }
}
