text: #include <stdio.h>
  int n,k,num,a[105],b[106];
  
  void qsort(int left, int right){
      if(left >= right){
          return ;
      }
      int i = left;
      int j = right;
      int key = a[left];
      int key1 = b[left];
       
      while(i < j){
          while(i < j && key <= a[j]){
              j--;
          }
          a[i] = a[j];
          b[i] = b[j];
          while(i < j && key >= a[i]){
  			i++;
          }
          a[j] = a[i];
          b[j] = b[i]; 
      }
      a[i] = key;
      b[i] = key1;
      qsort( left, i - 1);
      qsort( i + 1, right);
  }
  int main(){
  	int sum = 0;
  	scanf("%d%d",&n,&k);
  	for(int i = 1;i <= n;i++){
  		scanf("%d",&a[i]);
  	}
  	for(int i = 1;i <= n;i++){
  		b[i] = i;
  	}
  	qsort(1,n);
  //	for(int i = 1;i <= n;i++){
  //		printf("a[%d] = %d,b[%d] = %d\n",i,a[i],i,b[i]);
  //	}
  	for(int i = 1;i <= n;i++){
  		sum += a[i];
  		if(sum > k){
  			sum -= a[i];
  			num = i-1;
  			break;
  		}
  		if(i == n){
  			num = n;
  		}
  	}
  //	printf("num = %d\n",num);
  	if(num == 0){
  		printf("0");
  	}else{
  		printf("%d\n",num);
  		for(int i = 1;i <= num;i++){
  			printf("%d ",b[i]);
  		}
  	}
  	
  	
  	return 0;
  }
  