import java.util.*

fun main(args: Array<String>) {
    val cin = Scanner(System.`in`)
    val N = cin.nextInt()
    val Y = cin.nextInt()

    for (x in 0..N) {
        for (y in 0..N-x) {
            val z = N - x - y
            if(10000*x + 5000*y + 1000*z == Y) {
                println("%d %d %d".format(x,y,z))
                return
            }
        }
    }
    println("-1 -1 -1")
}