#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1 << 18;
int N, T;
int a[MAXN];
int t[MAXN];
int order[MAXN];
int cnt[MAXN];
int pos[MAXN];
long long sum[MAXN];
bool my_cmp(int i, int j) {
  if (t[i] != t[j]) return t[i] < t[j];
  return a[i] < a[j];
}
void solve(int n) {
  int total_time = 0;
  int cnt = 0;
  for (int _i = 0; _i < N && cnt < n; ++_i) {
    int i = order[_i];
    if (a[i] >= n) {
      cout << i + 1 << endl;
      total_time += t[i];
      cnt++;
    }
  }
  assert(total_time <= T);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> N >> T;
  for (int i = 0; i < N; ++i) {
    cin >> a[i] >> t[i];
    order[i] = i;
  }
  sort(order, order + N, my_cmp);
  long long cur_sum = 0;
  pos[0] = 0;
  int cntk = 0;
  int best_k = 0;
  for (int i = 1; i <= N; ++i) {
    cntk -= cnt[i - 1];
    cur_sum -= sum[i - 1];
    int p = pos[i - 1];
    while (p < N && cntk < i) {
      if (a[order[p]] >= i) {
        cntk++;
        cnt[a[order[p]]]++;
        cur_sum += t[order[p]];
        sum[a[order[p]]] += t[order[p]];
      }
      ++p;
    }
    if (cntk < i) break;
    if (cur_sum <= T) {
      best_k = i;
    }
    pos[i] = p;
  }
  cout << best_k << endl << best_k << endl;
  solve(best_k);
  return 0;
}
