#include <bits/stdc++.h>
using namespace std;
const int mo = 1e9 + 7;
const int mn = 300050;
int n, T, a[mn], b[mn], id[mn];
int e[mn][2], la[mn], se = 1;
long long fac[mn], inv[mn];
long long Pow(long long x, int y) {
  return !y ? 1 : y == 1 ? x : Pow(x * x % mo, y >> 1) * Pow(x, y & 1) % mo;
}
void make(int x, int y) {
  e[++se][1] = y;
  e[se][0] = la[x];
  la[x] = se;
  e[++se][1] = x;
  e[se][0] = la[y];
  la[y] = se;
}
bool cmp(int x, int y) { return b[x] < b[y]; }
bool get(int x) {
  int m = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] >= x) id[++m] = i;
  if (m < x) return 0;
  sort(id + 1, id + m + 1, cmp);
  int sum = 0;
  for (int i = 1; i <= x; i++) sum += b[id[i]];
  return sum <= T;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i], &b[i]);
  int l = 0, r = n + 1;
  while (l + 1 < r) {
    if (get((l + r) >> 1))
      l = (l + r) >> 1;
    else
      r = (l + r) >> 1;
  }
  get(l);
  printf("%d\n%d\n", l, l);
  for (int i = 1; i <= l; i++) printf("%d ", id[i]);
  puts("");
  return 0;
}
