import java.util.Scanner

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

    for (f in (0..n)) {
        for (h in (0..n)) {
            if (f + h <= n && 9000 * f + 4000 * h == y - 1000 * n) {
                println("$f $h ${n - f - h}")
                return
            }
        }
    }
    println("-1 -1 -1")
}