#include <bits/stdc++.h>
using namespace std;
vector<int> v;
vector<pair<int, int> > vv;
int a[202020], t[202020];
int main() {
  int n, T;
  scanf("%d %d", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &t[i]);
  int l = 0, r = n;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    v.clear();
    for (int i = 1; i <= n; i++)
      if (a[i] >= mid) v.push_back(t[i]);
    sort(v.begin(), v.end());
    int x = T;
    int i;
    for (i = 0; i < v.size() && x >= v[i]; i++) x -= v[i];
    if (i >= mid)
      l = mid;
    else
      r = mid - 1;
  }
  printf("%d\n", l);
  for (int i = 1; i <= n; i++)
    if (a[i] >= l) vv.push_back(make_pair(t[i], i));
  sort(vv.begin(), vv.end());
  int x = T;
  int i;
  for (i = 0; i < vv.size() && i < l && x >= vv[i].first; i++) x -= vv[i].first;
  printf("%d\n", i);
  i--;
  for (; i >= 0; i--) printf("%d ", vv[i].second);
  puts("");
  return 0;
}
