function main(argString) {
  	var input = argString.split(' ').map(v => Number(v));
  	console.log(...loop(input[0], input[1]));
}

function loop(N, Y) {
  	for (var i = 0; i <= N; i++) {
      	for (var k = 0; k <= N - i; k++) {
        	var m = N - i - k;
        	if ((i + k + m) === N && (i * 10000 + k * 5000 + m * 1000) === Y) return [i, k, m];
        }
    }
  	return [-1, -1, -1];
}
 
main(require("fs").readFileSync("/dev/stdin", "utf8"));
