#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x;
  cin >> n >> x;
  int a[110];
  for (int i = 0; i < n; ++i) cin >> a[i];
  sort(a, a + n);
  int p = 0;
  if (x >= a[0]) {
    for (int j = 0; j < n; ++j) {
      if (x < a[j]) break;
      x -= a[j];
      ++p;
      cout << p << " ";
    }
    cout << endl;
    if (x > 0) --p;
    cout << p << endl;
  } else
    cout << "0" << endl;
}
