#include <bits/stdc++.h>
using namespace std;
const int N = 200500;
int a[N];
int t[N];
int n, m;
struct Info {
  int id;
  int val;
} xu[N];
int cc;
int getint() {
  char ch = getchar();
  int res = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  bool neg = 0;
  if (ch == '-') {
    neg = 1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    res = res * 10 + ch - '0';
    ch = getchar();
  }
  if (neg) res = -res;
  return res;
}
bool cmp(Info x, Info y) { return (x.val < y.val); }
bool Can(int x) {
  int i;
  cc = 0;
  for (i = 1; i <= n; i++) {
    if (a[i] >= x) {
      cc++;
      xu[cc].id = i;
      xu[cc].val = t[i];
    }
  }
  sort(xu + 1, xu + cc + 1, cmp);
  int now = m;
  if (cc < x) return 0;
  for (i = 1; i <= x; i++) {
    now -= xu[i].val;
    if (now < 0) return 0;
  }
  return 1;
}
int main() {
  n = getint();
  m = getint();
  int i, j;
  for (i = 1; i <= n; i++) {
    a[i] = getint();
    t[i] = getint();
  }
  int l = 0, r = n;
  while (l < r) {
    int mid = (l + r + 1) / 2;
    if (Can(mid))
      l = mid;
    else
      r = mid - 1;
  }
  Can(l);
  printf("%d\n%d\n", l, l);
  for (i = 1; i <= l; i++) printf("%d ", xu[i].id);
  return 0;
}
