'use strict'

// inputに入力データ全体が入る
function Main(input) {
  let row = input.split(' ');
  let n = parseInt(row[0], 10);
  let m = parseInt(row[1], 10);
  let r10000 = -1;
  let r5000 = -1;
  let r1000 = -1;
  for(let x = 0; x<= n; x++){
	  for(let y = 0; y<= n; y++){
        let rem = n - x - y;
        let sum = 10000*x + 5000*y + 1000*rem;
        if((sum === m) && (rem > -1 )){
        	r10000 = x;
            r5000 = y;
          	r1000 = rem;
          	break;
        }
      }
  }
  console.log('%s',`${r10000} ${r5000} ${r1000}`);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));