function Main(input) {
    input = input.split(" ");
    n = parseInt(input[0], 10);
    y = parseInt(input[1], 10);

    var ok = false;
    for (var i = 0; i <= n; i++) {
        for (var j = 0; j <= n; j++) {
            var k = n - i - j;
            if (k < 0) continue;
            if (10000 * i + 5000 * j + 1000 * k == y) {
                console.log("%d %d %d\n", i, j, k);
                ok = true;
                break;
            }
        }
        if (ok) break;
    }
    
    if (!ok) console.log("-1 -1 -1\n");
}

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