"use strict";
const main = arg => {
  let Nums = arg.split(" ");
  let X = -1,Y = -1,Z = -1;
  for(let i = 0; i <=Nums[0]; i++) {
    for(let j = 0; j <=Nums[0]; j++) {
		let k = Nums[0] - i - j;
      	if( k>=0 && (i*10000 + j*5000+ k*1000 == Nums[1])){
        	X = i;
          	Y = j;
          	Z = k;
        	break;
        }
    }  	
  }
  console.log(X + " "+ Y + " "+  Z);
}

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