#include <bits/stdc++.h>
using namespace std;
struct problem {
  int a, t, id;
  bool operator<(const problem &b) const { return t < b.t; }
} a[300001];
int n, t;
vector<int> sol, v;
bool check(int k) {
  int cnt = 0;
  v.clear();
  for (int i = 1, j = 0; i <= n && j + a[i].t <= t && cnt < k; i++)
    if (k <= a[i].a) cnt++, v.push_back(a[i].id), j += a[i].t;
  return cnt == k;
}
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 1; i <= n; i++) scanf("%d%d", &a[i].a, &a[i].t), a[i].id = i;
  sort(a + 1, a + 1 + n);
  int l = 0, r = n, ans = 0;
  while (l <= r) {
    int m = (l + r) >> 1;
    if (check(m))
      l = m + 1, ans = m, sol = v;
    else
      r = m - 1;
  }
  printf("%d\n%d\n", ans, int(sol.size()));
  for (int i : sol) printf("%d ", i);
  putchar('\n');
  return 0;
}
