'use strict';
function main(input) {
    var args = input.trim().split(' ').map((n) => parseInt(n, 10));
  	let result = '-1 -1 -1'
  	loopout:
  	for(let i=0;i<=args[0];i++) {
    for(let j=0;j<=args[0];j++) {
      if(i+j > args[0]) continue
      const k = args[0] - (i+j)
      if(i+j+k === args[0]){
        if(i*10000+j*5000+k*1000 === args[1]) {
          result = `${i} ${j} ${k}`
          console.log(result)
          break loopout;
        }
      }
    }
    }
    if (result === '-1 -1 -1') console.log(result)
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));