#include <bits/stdc++.h>
using namespace std;
bool compare(pair<int, int> a, pair<int, int> b) {
  if (a.first == b.first) return a.second < b.second;
  return a.first < b.first;
}
int main() {
  int n, t;
  cin >> n >> t;
  vector<vector<pair<int, int>>> a(n + 1);
  for (int i = 0; i < n; i++) {
    int ai, ti;
    cin >> ai >> ti;
    pair<int, int> tempp = {ti, i + 1};
    a[ai].push_back(tempp);
  }
  for (int i = 0; i < n; i++) sort(a[i].begin(), a[i].end());
  set<pair<int, int>> temp;
  int cnt = 0;
  for (int i = n; i > 0; i--) {
    int k = 0;
    while (temp.size() > i) {
      pair<int, int> ttt = *temp.rbegin();
      cnt -= ttt.first;
      temp.erase(ttt);
    }
    while (k < a[i].size()) {
      if (temp.size() == i) {
        pair<int, int> ttt = *temp.rbegin();
        if (a[i][k].first >= ttt.first) break;
      }
      temp.insert(a[i][k]);
      if (temp.size() > i) {
        pair<int, int> ttt = *temp.rbegin();
        cnt -= ttt.first;
        temp.erase(ttt);
      }
      cnt += a[i][k].first;
      k++;
    }
    if (temp.size() >= i && cnt <= t) {
      cout << i << endl << temp.size() << endl;
      for (pair<int, int> j : temp) cout << j.second << ' ';
      return 0;
    }
  }
  cout << 0 << endl << 0;
}
