#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;
int n;
int T;
set<pair<int, pair<int, int> > > active, active1;
set<int> set1;
map<int, vector<int> > map1;
pair<int, pair<int, int> > arr[nax];
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> T;
  for (int i = 1; i <= n; i++) {
    int ai, ti;
    cin >> ai >> ti;
    active.insert({ti, {ai, i}});
    map1[ai + 1].push_back(i);
    arr[i] = {ti, {ai, i}};
  }
  active1 = active;
  int maxans = 0;
  int curT = 0;
  int inside = 0;
  for (int i = 1; i <= n; i++) {
    for (auto x : map1[i]) {
      if (set1.find(x) != set1.end()) {
        inside--;
        curT -= arr[x].first;
        set1.erase(x);
      }
      active.erase(arr[x]);
    }
    while (!active.empty() && inside < i) {
      int idx = active.begin()->second.second;
      if (curT + arr[idx].first > T) break;
      active.erase(active.begin());
      set1.insert(idx);
      inside++;
      curT += arr[idx].first;
    }
    if (inside <= i) maxans = max(maxans, inside);
  }
  cout << maxans << "\n";
  cout << maxans << "\n";
  int realmaxans = maxans;
  maxans = 0;
  curT = 0;
  inside = 0;
  set1.clear();
  active.clear();
  active = active1;
  for (int i = 1; i <= n; i++) {
    for (auto x : map1[i]) {
      if (set1.find(x) != set1.end()) {
        inside--;
        curT -= arr[x].first;
        set1.erase(x);
      }
      active.erase(arr[x]);
    }
    while (!active.empty() && inside < i) {
      int idx = active.begin()->second.second;
      if (curT + arr[idx].first > T) break;
      active.erase(active.begin());
      set1.insert(idx);
      inside++;
      curT += arr[idx].first;
    }
    if (inside <= i) maxans = max(maxans, inside);
    if (maxans == realmaxans) {
      for (auto x : set1) cout << x << " ";
      return 0;
    }
  }
  return 0;
}
