#include <bits/stdc++.h>
using namespace std;
int n, t;
const int MAXN = 2 * 1000 * 100 + 10;
int a[MAXN], t1[MAXN];
int cnt[MAXN];
set<pair<int, int>> s;
vector<int> ans;
bool choose(int ind) {
  int tm = 0;
  set<pair<int, int>> tmp;
  set<pair<int, int>>::iterator it = s.begin();
  while (it != s.end()) {
    if (a[it->second] >= ind) {
      tmp.insert(*it);
    }
    it++;
  }
  it = tmp.begin();
  if (tmp.size() < ind) return false;
  for (int i = 0; i < ind; i++) {
    tm += it->first;
    if (tm > t) return false;
    it++;
  }
  return true;
}
void ch(int ind) {
  int tm = 0;
  set<pair<int, int>> tmp;
  set<pair<int, int>>::iterator it = s.begin();
  while (it != s.end()) {
    if (a[it->second] >= ind) {
      tmp.insert(*it);
    }
    it++;
  }
  it = tmp.begin();
  for (int i = 0; i < ind; i++) {
    ans.push_back(it->second + 1);
    it++;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> t;
  for (int i = 0; i <= n; i++) {
    cnt[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> t1[i];
    s.insert({t1[i], i});
  }
  int l = 0, r = n + 1;
  while (l + 1 < r) {
    int mid = (l + r) / 2;
    if (choose(mid))
      l = mid;
    else
      r = mid;
  }
  ch(l);
  cout << l << endl << l << endl;
  while (!ans.empty()) {
    cout << ans.back() << " ";
    ans.pop_back();
  }
  cout << endl;
  return 0;
}
