
function Main(input) {
    var N = parseInt(input[0], 10);
    var Y = parseInt(input[1], 10);

    for (var a = 0; a <= N; a++) {
        for (var b = 0; (a + b) <= N; b++) {
            var c = N - a - b;
            var total = a * 10000 + b * 5000 + c * 1000;
            if (total === Y) {
                console.log(`${a} ${b} ${c}`);
                return;
            }
        }
    }
    console.log('-1 -1 -1');
}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim().split(/\n|\s/));