function main(input) {
    input=input.split(" ");
    var N = parseInt(input[0],10);
    var Y = parseInt(input[1],10);
    //console.log(input);
    var result =''
   for (var x=0;x<=N; x++){
     for(var y=0;y<=(N-x);y++){
     var z=(N-x-y)
      if(10000*x+5000*y+1000*z===Y){
        console.log(x+' '+y+' '+z);
        result='OK';
        break;
      }
     }
     if (result ==='OK'){
     break;
     }
   }
   if (result ===''){
     console.log('-1 -1 -1')
   }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));