#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int MAXN = 200500;
int high[MAXN];
int times_to_solve[MAXN];
int time_limit;
int n;
int real_solved;
vector<pair<int, int>> times(MAXN);
int sz;
bool f(int mid) {
  sz = 0;
  for (int i = 0; i < n; i++) {
    if (high[i] >= mid) {
      times[sz++] = {times_to_solve[i], i};
    }
  }
  sort(times.begin(), times.begin() + sz);
  real_solved = 0;
  int lim = time_limit;
  for (int i = 0; i < min(sz, mid); i++) {
    if (lim < times[i].first) break;
    real_solved++;
    lim -= times[i].first;
  }
  return real_solved >= mid;
}
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> time_limit;
  for (int i = 0; i < n; i++) {
    cin >> high[i] >> times_to_solve[i];
  }
  int le = 0, rg = n + 1;
  while (rg - le > 1) {
    int mid = (le + rg) / 2;
    if (f(mid))
      le = mid;
    else
      rg = mid;
  }
  f(le);
  cout << le << endl;
  cout << real_solved << endl;
  for (int i = 0; i < real_solved; i++) cout << times[i].second + 1 << " ";
  return 0;
}
