process.stdin.resume();
process.stdin.setEncoding('utf8');

function tansaku(N, Y) {
    for (var i = 0; i <= N; i++) {
        for (var j = 0; j <= N; j++) {
            for (var k = 0; k <= N; k++) {
                var total = 10000 * i + 5000 * j + 1000 * k;
                var num = i + j + k;
                if (num === N && total === Y) {
                    return i + " " + j + " " + k;
                }
            }
        }
    }
    return "-1 -1 -1";
}

function Main(input) {
    var inputs = input.split(" ");
    
    var N = parseInt(inputs[0]),
        Y = parseInt(inputs[1]);

    console.log(tansaku(N, Y));
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));