process.stdin.resume();
process.stdin.setEncoding('utf8');
 
var lines = [];
var reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
reader.on('line', (line) => {
    // ここで入力を処理する
    lines.push(line);
});
var sub_fn = (ary)=>{
  
}
reader.on('close', () => {
  var x = 1*lines[0].split(' ')[0]
  var y = 1*lines[0].split(' ')[1]
  var cnt = [];
 // console.log(y)
  for(var i=0;i<=x;i++){
      if(cnt.length){break}
      //  console.log(i)
    for(var j=0;j<=(x-i);j++){
      if(cnt.length){break}
      var k = x-j-i
      
      //for(var k=0;k<=(x-j-i);k++){
        //console.log(i)
        if((10000*i + 5000*j + 1000*k) == y && (i+j+k)== x){
           console.log(i +' '+ j +' '+ k)
        cnt.push([i,j,k])
        //  console.log(i +" "+ j +" "+ k)
          break
          
        
       }    
    //  }
    }
  }
  if(cnt.length == 0){
  console.log('-1 -1 -1')
  }else{
  //console.log(cnt[cnt.length-1][0] +" "+ cnt[cnt.length-1][1] +" "+ cnt[cnt.length-1][2])
  }
  
});
