function main(input) {
	const args = input.split(' ').map((n) => parseInt(n, 10));
  	const N = args[0];
  	const Y = args[1];
  
  	let result = '-1 -1 -1';
  
  	for (let i = 0; i <= N; i++) {
      for (let j = 0; j <= N; j++) {
        if ((i + j) > N) { continue; }
        
      	let k = N - i - j;
        
        total = (10000*i) + (5000*j) + (1000*k);
        if (total === Y) {
          result = `${i} ${j} ${k}`;
          break;
        }
      }
    }
  	
  	console.log(result);
}

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