#include <bits/stdc++.h>
using namespace std;
int n;
long long T;
int a[200020], t[200020];
vector<int> X[200020];
void solve() {
  scanf("%d%lld", &n, &T);
  for (int i = 1; i <= n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    a[i] = x, t[i] = y;
    X[a[i]].push_back(i);
  }
  set<pair<int, int> > S1, S2;
  for (int i = 1; i <= n; i++) S1.insert(pair<int, int>(t[i], i));
  long long c = 0;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int e : X[i - 1]) {
      if (S1.find(pair<int, int>(t[e], e)) != S1.end())
        S1.erase(S1.find(pair<int, int>(t[e], e)));
      else
        S2.erase(S2.find(pair<int, int>(t[e], e))), c -= t[e];
    }
    while (((int)(S2).size()) < i && ((int)(S1).size()) > 0) {
      S2.insert(*S1.begin());
      c += S1.begin()->first;
      S1.erase(S1.begin());
    }
    if (((int)(S2).size()) == i && c <= T) ans = i;
  }
  printf("%d\n", ans);
  S1.clear();
  S2.clear();
  for (int i = 1; i <= n; i++) S1.insert(pair<int, int>(t[i], i));
  for (int i = 1; i <= ans; i++) {
    for (int e : X[i - 1]) {
      if (S1.find(pair<int, int>(t[e], e)) != S1.end())
        S1.erase(S1.find(pair<int, int>(t[e], e)));
      else
        S2.erase(S2.find(pair<int, int>(t[e], e))), c -= t[e];
    }
    while (((int)(S2).size()) < i && ((int)(S1).size()) > 0) {
      S2.insert(*S1.begin());
      c += S1.begin()->first;
      S1.erase(S1.begin());
    }
  }
  vector<int> v;
  for (pair<int, int> e : S2) v.push_back(e.second);
  sort((v).begin(), (v).end());
  printf("%d\n", ((int)(v).size()));
  for (int e : v) printf("%d ", e);
  puts("");
}
int main() {
  int Tc = 1;
  for (int tc = 1; tc <= Tc; tc++) {
    solve();
  }
  return 0;
}
