#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, r = 0, a = 0, t = 0, f = 0;
  ;
  cin >> n >> m;
  pair<int, int> A[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> A[i].first;
    A[i].second = i;
  }
  int d = 0;
  sort(A, A + n + 1);
  for (int i = 1; i <= n; i++) {
    d = 0;
    f = 0;
    for (int j = 1; j <= n; j++) {
      if (d + A[j].first <= m) {
        d += A[j].first;
        f++;
      }
    }
    if (d > r) {
      a = i;
      r = d;
      t = f;
    }
  }
  if (t == 0) {
    cout << t;
    return 0;
  }
  cout << t << endl;
  d = 0;
  for (int i = a; i <= n; i++) {
    if (d + A[i].first <= m) {
      d += A[i].first;
      cout << A[i].second << " ";
    } else
      break;
  }
  return 0;
}
