fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val N = sc.next().toInt()
    val Y = sc.next().toInt()

    fun check(x:Int, y:Int, z:Int): Boolean {
        return when {
            z < 0 -> false
            x * 10000 + y * 5000 + z * 1000 != Y -> false
            else -> {
                println("$x $y $z")
                true
            }
        }
    }

    for (i in 0..N){
        for (j in 0..N) {
            if (check(i, j, N-i-j)) {
                return
            }
        }
    }

    println("-1 -1 -1")
}