#include <bits/stdc++.h>
using namespace std;
const int MaxN = (int)2e5 + 10;
const int INF = 0x3F3F3F3F;
struct task_t {
  int a, t, id;
  bool operator<(task_t const& other) const { return t < other.t; }
} tasks[MaxN];
int res[MaxN], m;
int main() {
  int n, T;
  scanf("%d%d", &n, &T);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &tasks[i].a, &tasks[i].t);
    tasks[i].id = i + 1;
  }
  sort(tasks, tasks + n);
  int l = 0, r = n;
  while (l < r) {
    int mid = (l + r + 1) >> 1;
    int left = T, cur = 0;
    for (int i = 0; cur < mid && i < n; i++) {
      if (tasks[i].t > left) break;
      if (tasks[i].a >= mid) {
        left -= tasks[i].t;
        cur++;
      }
    }
    if (cur == mid)
      l = mid;
    else
      r = mid - 1;
  }
  m = 0;
  for (int i = 0; m < l && i < n; i++) {
    if (tasks[i].t > T) break;
    if (tasks[i].a >= l) {
      T -= tasks[i].t;
      res[m++] = tasks[i].id;
    }
  }
  printf("%d\n", l);
  printf("%d\n", m);
  for (int i = 0; i < m; i++) printf("%d%c", res[i], " \n"[i == m - 1]);
  if (m == 0) puts("");
  return 0;
}
