#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long T;
  cin >> n >> T;
  int a[n], t[n];
  for (int i = 0; i < n; i++) cin >> a[i] >> t[i];
  long long lo = 0, hi = n;
  while (lo < hi) {
    long long z = (lo + hi + 1) / 2;
    vector<int> S;
    for (int i = 0; i < n; i++)
      if (a[i] >= z) S.emplace_back(i);
    sort(S.begin(), S.end(),
         [&](const int& i, const int& j) { return t[i] < t[j]; });
    long long tot = 0, solved = 0;
    for (int i = 0; i < S.size(); i++) {
      if (tot + t[S[i]] > T) break;
      tot += t[S[i]];
      solved++;
    }
    if (solved >= z)
      lo = z;
    else
      hi = z - 1;
  }
  int score = lo;
  vector<int> toSolve;
  for (int i = 0; i < n; i++)
    if (a[i] >= score) toSolve.emplace_back(i);
  sort(toSolve.begin(), toSolve.end(),
       [&](const int& i, const int& j) { return t[i] < t[j]; });
  while (toSolve.size() > score) toSolve.pop_back();
  cout << score << '\n' << score << '\n';
  for (const auto& i : toSolve) cout << 1 + i << ' ';
  cout << endl;
  return 0;
}
