#include <bits/stdc++.h>
using namespace std;
set<pair<pair<long long, long long>, long long> > used;
set<pair<pair<long long, long long>, long long> > unused;
set<long long> bestRes;
vector<long long> updates;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, i, k, t, sum = 0, a, b;
  cin >> n >> t;
  for (i = 0; i < n; i++) {
    cin >> a >> b;
    unused.insert({{b, a}, i + 1});
  }
  auto it = unused.begin();
  for (k = 1; k <= n; k++) {
    while (used.size() > 0 && used.begin()->first.first < k) {
      sum -= used.begin()->first.second;
      updates.push_back(used.begin()->second);
      used.erase(used.begin());
    }
    while (it != unused.end() && used.size() < k) {
      if (it->first.second < k) {
        it++;
        continue;
      }
      if (sum + it->first.first <= t) {
        sum += it->first.first;
        used.insert({{it->first.second, it->first.first}, it->second});
        updates.push_back(it->second);
        it++;
      } else {
        break;
      }
    }
    if (used.size() > bestRes.size()) {
      for (auto itt : updates) {
        if (bestRes.find(itt) == bestRes.end()) {
          bestRes.insert(itt);
        } else {
          bestRes.erase(bestRes.find(itt));
        }
      }
      updates.clear();
    }
  }
  cout << bestRes.size() << "\n" << bestRes.size() << "\n";
  for (auto ittt : bestRes) {
    cout << ittt << " ";
  }
  return 0;
}
