import java.io.InputStream
import java.io.PrintStream
import java.util.*

class Abc085C(
    val input: InputStream,
    val output: PrintStream
) {
    /**
     * 1000 ≤ Y ≤ 200,000,000
     */
    fun proc() {
        val sc = Scanner(input)
        val N = sc.nextInt()
        val Y = sc.nextInt()

        val xn = Math.min(N, Y / 10000)
        for (x in xn downTo 0) {
            if (x * 10000 > Y) {
                continue
            }

            val yn = Math.min(N - x, Y / 5000)
            for (y in yn downTo 0) {
                if (x * 10000 + y * 5000 > Y) {
                    continue
                }

                val zn = Math.min(N - x - y, Y / 1000)
                for (z in zn downTo 0) {
                    if (x + y + z != N) {
                        continue
                    }

                    if (x * 10000 + y * 5000 + z * 1000 == Y) {
                        output.print("$x $y $z")
                        return
                    }
                }
            }
        }
        output.print("-1 -1 -1")
    }
}

fun main(args: Array<String>) {
    Abc085C(System.`in`, System.out).proc()
}
