#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
int T, n, k;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    que[200015];
priority_queue<pair<int, int>, vector<pair<int, int> >, less<pair<int, int> > >
    Q;
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; ++i) {
    int t, a;
    scanf("%d%d", &a, &t);
    que[a].push(pair<int, int>(t, i));
  }
  int cnt_T = 0;
  for (k = n; k; --k) {
    int flag_add = 1, flag_evic = 1;
    while (flag_add | flag_evic) {
      flag_add = flag_evic = 0;
      while (que[k].size() && Q.size() < k) {
        pair<int, int> px = que[k].top();
        int x = px.first;
        if (cnt_T + x <= T) {
          cnt_T += x;
          que[k].pop();
          Q.push(px);
          flag_add = 1;
        } else {
          break;
        }
      }
      if (Q.size() == k) break;
      if (Q.empty()) continue;
      if (que[k].size()) {
        pair<int, int> px = que[k].top(), py = Q.top();
        int x = px.first, y = py.first;
        if (x < y) {
          que[k].pop();
          Q.pop();
          Q.push(px);
          cnt_T += x - y;
          flag_evic = 1;
        }
      }
    }
    if (Q.size() == k) break;
  }
  printf("%d\n%d\n", k, k);
  for (int i = 0; i < k; ++i) {
    printf("%d ", Q.top().second);
    Q.pop();
  }
  return 0;
}
