#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
  vector<string> v;
  stringstream ss(s);
  string x;
  while (getline(ss, x, c)) v.emplace_back(x);
  return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
  cerr << it->substr((*it)[0] == ' ', it->length()) << " = " << a << '\t';
  err(++it, args...);
}
const int NN = 1e6 + 5;
long long int a[NN], t[NN];
long long int T;
vector<pair<int, int> > ttt;
int fun(int x, int n) {
  ttt.clear();
  for (int i = 0; i < n; i++) {
    if (a[i] >= x) {
      ttt.emplace_back(t[i], i + 1);
    }
  }
  sort(ttt.begin(), ttt.end());
  long long int cnt = 0, so = 0;
  for (int i = 0; i < ttt.size(); i++) {
    so += ttt[i].first;
    if (so > T) break;
    cnt++;
  }
  return cnt;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m, k, i, j, lb, ub, mid;
  cin >> n >> T;
  for (i = 0; i < n; i++) {
    cin >> a[i] >> t[i];
  }
  lb = 1;
  ub = n;
  j = 0;
  while (lb <= ub && j++ < 30) {
    mid = (lb + ub) / 2;
    k = fun(mid, n);
    if (k >= mid) {
      lb = mid;
    } else {
      ub = mid - 1;
    }
    if (ub - lb == 1) {
      if (fun(ub, n) >= ub) lb = ub;
      break;
    }
  }
  if (fun(lb, n) >= lb) {
    cout << lb << endl << lb << endl;
    for (i = 0; i < lb; i++) {
      cout << ttt[i].second << " ";
    }
  } else {
    cout << "0\n0";
  }
  return 0;
}
