#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  int n, T;
  cin >> n >> T;
  vector<int> a(n), t(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> t[i];
  }
  vector<int> res;
  int low = 0, high = n;
  while (low < high) {
    int mid = (low + high + 1) >> 1;
    vector<pair<int, int> > e;
    for (int i = 0; i < n; i++)
      if (a[i] >= mid) e.emplace_back(t[i], i);
    sort(e.begin(), e.end());
    bool ok = false;
    if ((int)e.size() >= mid) {
      int sum = 0;
      for (int i = 0; i < mid; i++) sum += e[i].first;
      if (sum <= T) {
        ok = true;
        res.resize(mid);
        for (int i = 0; i < mid; i++) res[i] = e[i].second;
      }
    }
    if (ok)
      low = mid;
    else
      high = mid - 1;
  }
  int sz = (int)res.size();
  cout << sz << endl << sz << endl;
  for (int i = 0; i < sz; i++) cout << res[i] + 1 << " ";
  return !(cout << endl);
}
