#include <bits/stdc++.h>
using namespace std;
int n, T, l, r, sum, crt, x, y, mij, rsp;
pair<pair<int, int>, int> v[200005];
int main() {
  cin >> n >> T;
  for (int i = 1; i <= n; ++i) {
    cin >> x >> y;
    v[i] = {{y, x}, i};
  }
  sort(v + 1, v + n + 1);
  l = 1;
  r = n;
  while (l <= r) {
    mij = (l + r) / 2;
    sum = 0;
    crt = 0;
    for (int i = 1; i <= n; ++i) {
      if (v[i].first.second < mij) continue;
      if (v[i].first.first + sum > T) break;
      sum += v[i].first.first;
      crt++;
    }
    if (crt >= mij) {
      rsp = mij;
      l = mij + 1;
    } else
      r = mij - 1;
  }
  cout << rsp << '\n' << rsp << '\n';
  crt = 0;
  for (int i = 1; i <= n && crt != rsp; ++i) {
    if (v[i].first.second < rsp) continue;
    cout << v[i].second << " ";
    crt++;
  }
  return 0;
}
