#include <bits/stdc++.h>
using namespace std;
int n, Time;
struct Prob {
  int a, t, pos;
  bool operator<(const Prob &ot) const {
    if (a == ot.a) return t < ot.t;
    return a > ot.a;
  }
} p[200002];
int cmp(const Prob x, const Prob y) {
  if (x.t == y.t) return x.a > y.a;
  return x.t < y.t;
}
priority_queue<int> T;
int ans;
long long sum;
int main() {
  scanf("%d%d", &n, &Time);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &p[i].a, &p[i].t);
    p[i].pos = i;
    ans = max(ans, p[i].a);
  }
  int j = 1, sz = 0;
  sort(p + 1, p + n + 1);
  for (; ans > 0; --ans) {
    while (sz > ans) {
      --sz;
      sum -= T.top();
      T.pop();
    }
    while (j <= n && p[j].a >= ans) {
      T.push(p[j].t);
      sum += p[j].t;
      ++sz;
      if (sz > ans) {
        sum -= T.top();
        T.pop();
        --sz;
      }
      ++j;
    }
    if (sum <= Time && sz >= ans) break;
  }
  printf("%d\n%d\n", ans, ans);
  for (int i = 1; i <= n; ++i)
    if (p[i].a < ans) p[i].t = Time + 1;
  sort(p + 1, p + n + 1, cmp);
  for (int i = 1; i <= ans; ++i) printf("%d ", p[i].pos);
  return 0;
}
