"use strict";

function main(input) {
    input = input.split(' ');
  	const N = parseInt(input[0]);
  	const Y = parseInt(input[1]);
  	
  	let combination = []
  	for(let i=0; i<N; i++) {// the number of 10,000札
  	    if(combination.length > 0)break;
  	    for(let j=0; j<N; j++) {// the number of 5,000札
  	        const num = N - (i+j)// the number of 1,000札
  	        const sum = 10000*i+5000*j+1000*num
  	        if(num >= 0 && num <= N && sum === Y) {
  	            combination.push(i,j,num)
  	            break;
  	        }
  	    }
  	}
  	
  	if(!combination.length) {
  	    combination.push(-1,-1,-1)
  	}
	
	console.log(combination.map(c=>c.toString()).join(" "))

}

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