#include <bits/stdc++.h>
using namespace std;
struct Prob {
  int limit;
  int time;
  int number;
  bool operator<(const Prob &a) const { return this->time < a.time; }
};
std::vector<Prob> q;
bool compareProb(const Prob &a, const Prob &b) {
  if (a.limit == b.limit)
    return a.time < b.time;
  else
    return a.limit > b.limit;
}
std::priority_queue<Prob> myQ;
std::priority_queue<Prob> maxQ;
int main() {
  int n, T;
  scanf("%d%d", &n, &T);
  Prob newProb;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &(newProb.limit), &(newProb.time));
    newProb.number = i + 1;
    q.push_back(newProb);
  }
  sort(q.begin(), q.end(), compareProb);
  int target = n;
  int total = 0;
  int p = 0;
  Prob curTop;
  while (myQ.size() < target) {
    if (p >= q.size()) break;
    if (myQ.size() > q[p].limit) break;
    if ((total + q[p].time) <= T) {
      myQ.push(q[p]);
      if (target > q[p].limit) target = q[p].limit;
      total = total + q[p].time;
      p++;
      continue;
    }
    if (myQ.empty()) {
      p++;
      continue;
    }
    curTop = myQ.top();
    if (curTop.time <= q[p].time) {
      p++;
      continue;
    } else {
      total = total - curTop.time;
      myQ.pop();
      myQ.push(q[p]);
      total = total + q[p].time;
      if (target > q[p].limit) target = q[p].limit;
      p++;
      continue;
    }
  }
  maxQ = myQ;
  if (target > maxQ.size()) target = maxQ.size();
  printf("%d\n", target);
  printf("%d\n", maxQ.size());
  if (maxQ.size() > 0) {
    curTop = maxQ.top();
    maxQ.pop();
    printf("%d", curTop.number);
    while (!maxQ.empty()) {
      curTop = maxQ.top();
      maxQ.pop();
      printf(" %d", curTop.number);
    }
    printf("\n");
  }
  return 0;
}
