fun main(args: Array<String>) {
    val sLine = readLine()?.split(" ").orEmpty()
    val numN = sLine[0].toInt()
    val numY = sLine[1].toInt()

    var yukichi = - 1
    var ichiyo = - 1
    var goro = - 1


    run loop@{
        for(i in 0 .. numN){
            for( j in 0 .. numN - i){
                var sum = 10000 * i + 5000 * j + 1000 * (numN - i - j)
                if(sum == numY){
                    yukichi = i
                    ichiyo = j
                    goro = numN - i - j
                    return@loop
                }

            }
        }
    }


    println("$yukichi $ichiyo $goro")
}