console.log((args=>{
  const [[N,Y]] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  for ( let i = 0; i <= N; i++ ) {
    for ( let j = 0; i + j <= N; j++ ) {
      const k = N - i - j;
      if ( i*10000 + j*5000 + k*1000 === Y ) return `${i} ${j} ${k}`;
    }
  }
  return '-1 -1 -1';
})(require('fs').readFileSync('/dev/stdin', 'utf8')));
