#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int T;
  cin >> T;
  vector<pair<pair<int, int>, int> > v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i].first.first >> v[i].first.second;
    v[i].second = i;
  }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  multiset<long long int> s;
  long long int sum = 0, index = 0;
  int ans = 0;
  for (int i = n; i > 0; i--) {
    while (index < n && v[index].first.first == i) {
      s.insert(v[index].first.second);
      sum += v[index].first.second;
      index++;
    }
    while (sum > T) {
      long long int temp = *s.rbegin();
      s.erase(s.find(temp));
      sum -= temp;
    }
    ans = max(ans, min(i, (int)s.size()));
  }
  vector<pair<int, int> > h;
  for (int i = 0; i < n; i++)
    if (v[i].first.first >= ans)
      h.push_back(make_pair(v[i].first.second, v[i].second));
  sort(h.begin(), h.end());
  ans = min((int)h.size(), (int)ans);
  cout << ans << "\n";
  cout << ans << "\n";
  for (int i = 0; i < ans; i++) cout << h[i].second + 1 << " ";
  cout << "\n";
}
