"use strict";

function main(input) {
    input = input.split(' ');
  	const N = parseInt(input[0]);
  	const Y = parseInt(input[1]);
  	
  	let combination = []

  	/* ristrictions */
  	if(N < 1 || N > 2000) {
  	    // violation
  	} else if(Y < 1000 || Y > 2*Math.pow(10,7)) {
  	    // violation
  	} else {
      	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
      	        //console.log(`i=${i},j=${j},num=${num},sum=${sum},Y=${Y}`)
      	        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"));