#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
long long int n, T;
pair<pair<long long int, long long int>, long long int> p[N];
bool ok(long long int k) {
  vector<long long int> tmp;
  long long int sum = 0;
  for (long long int i = 0; i < n; i++)
    if (p[i].first.second >= k) tmp.push_back(p[i].first.first);
  if ((long long int)tmp.size() < k) return 0;
  sort(tmp.begin(), tmp.end());
  for (long long int i = 0; i < k; i++) sum += tmp[i];
  return sum <= T;
}
void solve() {
  cin >> n >> T;
  for (long long int i = 0; i < n; i++) {
    cin >> p[i].first.second >> p[i].first.first;
    p[i].second = i + 1;
  }
  long long int l = 0, r = n;
  while (r - l > 1) {
    long long int mid = (l + r) / 2;
    if (ok(mid))
      l = mid;
    else
      r = mid;
  }
  if (ok(r)) {
    cout << r << endl << r << endl;
    vector<pair<long long int, long long int> > ans;
    for (long long int i = 0; i < n; i++)
      if (p[i].first.second >= r)
        ans.push_back({p[i].first.first, p[i].second});
    sort(ans.begin(), ans.end());
    for (long long int i = 0; i < r; i++) cout << ans[i].second << " ";
  } else if (ok(l)) {
    cout << l << endl << l << endl;
    vector<pair<long long int, long long int> > ans;
    for (long long int i = 0; i < n; i++)
      if (p[i].first.second >= l)
        ans.push_back({p[i].first.first, p[i].second});
    sort(ans.begin(), ans.end());
    for (long long int i = 0; i < l; i++) cout << ans[i].second << " ";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int T = 1;
  while (T--) solve();
  return 0;
}
