function main(input) {
    const [N, Y] = input.split(' ').map(n => parseInt(n, 10));
    let result = '-1 -1 -1';

    for(let a = 0; a <= N; a++ ) {
        for(let b = 0; b <= N; b++) {
            if( a + b > N ) continue;
            const sum = a * 10000 + b * 5000 + (N - a - b) * 1000;
            if( sum === Y ) {
                result = `${a} ${b} ${N - a - b}`;
                break;
            }

        }
    }
    console.log(result);
}

main( require('fs').readFileSync('/dev/stdin', 'utf8') );