#include <bits/stdc++.h>
using namespace std;
typedef struct problem {
  long long a;
  long long t;
  long long id;
} problem;
bool cmp(problem a, problem b) { return a.t < b.t; }
problem p[200001];
long long ans[200001], anss;
long long n, T;
bool check(long long x) {
  long long pt = 0, nowt = 0;
  for (long long i = 0; i < n; i++)
    if (p[i].a >= x) {
      if (nowt + p[i].t <= T) {
        nowt += p[i].t;
        ans[pt++] = p[i].id;
      }
    }
  if (pt >= x)
    return true;
  else
    return false;
}
long long binarysearch(long long l, long long r) {
  long long mid = ((l + r) >> 1);
  if (l == r)
    return l;
  else if (r - l == 1) {
    if (check(r))
      return r;
    else
      return l;
  } else if (check(mid))
    return binarysearch(mid, r);
  else
    return binarysearch(l, mid - 1);
}
int main() {
  scanf("%I64d%I64d", &n, &T);
  for (long long i = 0; i < n; i++) {
    scanf("%I64d%I64d", &p[i].a, &p[i].t);
    p[i].id = i + 1;
  }
  sort(p, p + n, cmp);
  anss = binarysearch(0, n);
  check(anss);
  printf("%I64d\n", anss);
  printf("%I64d\n", anss);
  for (long long i = 0; i < anss - 1; i++) printf("%I64d ", ans[i]);
  if (anss)
    printf("%I64d\n", ans[anss - 1]);
  else
    printf("\n");
  return 0;
}
