#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  ll T;
  cin >> n >> T;
  vector<vector<pair<ll, int>>> problems(n);
  for (int i = 0; i < n; i++) {
    int a;
    ll t;
    cin >> a >> t;
    problems[a - 1].emplace_back(t, i + 1);
  }
  int ans = 0;
  priority_queue<pair<ll, int>> que;
  ll s = 0;
  for (int k = n; k >= 1; k--) {
    for (auto p : problems[k - 1]) {
      que.push(p);
      s += p.first;
    }
    while (que.size() > 0 && s > T) {
      s -= que.top().first;
      que.pop();
    }
    ans = max(ans, min(k, int(que.size())));
  }
  cout << ans << endl;
  if (ans == 0) {
    cout << 0 << endl;
    cout << endl;
  } else {
    while (que.size() > 0) que.pop();
    s = 0;
    for (int k = n; k >= ans; k--) {
      for (auto p : problems[k - 1]) {
        que.push(p);
        s += p.first;
      }
      while (que.size() > 0 && s > T) {
        s -= que.top().first;
        que.pop();
      }
    }
    vector<int> vs;
    while (que.size() > 0 && vs.size() < ans) {
      vs.push_back(que.top().second);
      que.pop();
    }
    cout << vs.size() << endl;
    if (vs.size() > 0) cout << vs[0];
    for (int i = 1; i < vs.size(); i++) {
      cout << " " << vs[i];
    }
    cout << endl;
  }
  return 0;
}
