#include <bits/stdc++.h>
using std::pair;
using std::sort;
using std::vector;
int n, T;
int main() {
  scanf("%d %d", &n, &T);
  vector<int> c(n), t(n), res;
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &c[i], &t[i]);
  }
  int l = 0, r = n + 1, mid = (l + r) / 2;
  int sum, flag;
  vector<pair<int, int>> a;
  while (l + 1 < r) {
    mid = (l + r) / 2;
    sum = 0;
    flag = 0;
    a.clear();
    for (int i = 0; i < n; ++i) {
      if (c[i] >= mid) {
        a.emplace_back(t[i], i);
      }
    }
    if (a.size() >= mid) {
      sort(a.begin(), a.end());
      sum = 0;
      for (int t = 0; t < mid; ++t) {
        sum += a[t].first;
      }
      if (sum <= T) {
        flag = 1;
      } else {
        flag = 0;
      }
    } else {
      flag = 0;
    }
    if (flag) {
      l = mid;
      res.resize(l);
      for (int p = 0; p < l; ++p) {
        res[p] = a[p].second;
      }
    } else {
      r = mid;
    }
  }
  printf("%d\n", l);
  printf("%d\n", res.size());
  for (int t = 0; t < res.size(); ++t) {
    printf("%d%c", res[t] + 1, t == res.size() - 1 ? '\n' : ' ');
  }
}
