#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000007;
int a[200010], t[200010];
int main() {
  ios_base::sync_with_stdio(false);
  int n, T;
  cin >> n >> T;
  vector<pair<int, pair<int, int>>> res;
  res.clear();
  for (int i = 0; i < n; i++) {
    cin >> a[i] >> t[i];
    res.push_back(make_pair(t[i], make_pair(a[i], i)));
  }
  sort(res.begin(), res.end());
  int mid, lo = 0, hi = n, sol = 0;
  while (lo <= hi) {
    mid = lo + (hi - lo) / 2;
    int cnt = 0;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      if (res[i].second.first >= mid) {
        if (cnt == mid) break;
        sum += res[i].first;
        cnt++;
      }
    }
    if (sum <= T && cnt == mid) {
      sol = max(sol, mid);
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  cout << sol << endl;
  cout << sol << endl;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (res[i].second.first >= sol) {
      if (cnt >= sol) break;
      cout << res[i].second.second + 1 << " ";
      cnt++;
    }
  }
  cout << endl;
  return 0;
}
