#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return (!b) ? a : gcd(b, a % b);
}
int n, tt;
const int N = 2e5 + 5;
int a[N], t[N];
vector<vector<pair<int, int> > > f(N);
void solve() {
  cin >> n >> tt;
  for (int i = 1; i <= n; i++) {
    cin >> a[i] >> t[i];
    f[a[i]].push_back({t[i], i});
  }
  set<pair<int, int> > st;
  int tot = 0;
  for (int k = n; k >= 0; k--) {
    for (auto x : f[k]) {
      tot += x.first;
      st.insert({x.first, x.second});
    }
    while ((int)st.size() > k) {
      tot -= (*st.rbegin()).first;
      st.erase(--st.end());
    }
    if ((int)st.size() == k && tot <= tt) {
      cout << (int)st.size() << '\n' << (int)st.size() << '\n';
      for (auto x : st) cout << x.second << " ";
      break;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  }
  solve();
}
