#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
struct prb {
  int a, t, id;
} s[N];
bool cmp(prb a, prb b) { return a.t < b.t; }
int n, t;
vector<int> ans;
bool isok(int x) {
  int tt = t;
  vector<int> tmp;
  for (int i = 1; i <= n && tmp.size() < x; i++)
    if (s[i].a >= x && s[i].t <= tt) {
      tt -= s[i].t;
      tmp.push_back(s[i].id);
    }
  if (tmp.size() == x) ans = tmp;
  return tmp.size() == x;
}
int main() {
  cin >> n >> t;
  for (int i = 1; i <= n; i++) {
    cin >> s[i].a >> s[i].t;
    s[i].id = i;
  }
  sort(s + 1, s + 1 + n, cmp);
  int l = 0, r = n;
  while (l < r) {
    int m = l + r + 1 >> 1;
    if (isok(m))
      l = m;
    else
      r = m - 1;
  }
  cout << l << '\n' << l << endl;
  if (l) {
    cout << ans[0];
    for (int i = 1; i < ans.size(); i++) cout << ' ' << ans[i];
  }
  cout << endl;
  return 0;
}
