function main(input){
  var str = input.split(' ');
  var int = [];
  int.push(parseInt(str[0]));//入っているお札の枚数:N
  int.push(parseInt(str[1]));//合計金額:Y
  
  money:
  for(let i=0;i<=int[0];i++){
    for(let j=0;j<=int[0];j++){
      var com = 9*i+4*j;
      if(com === int[1]/1000-int[0]){
        var thou = int[0] - (i+j);
      	if(thou >=0){
          var fiveThou = j;
          var tenThou = i;
           break money;
        }else{
          continue;
        }
      }else{
        var thou = -1;
        var fiveThou = -1;
        var tenThou = -1;
      }
    }
  }
  console.log(tenThou+' '+fiveThou+' '+thou);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));