#include <bits/stdc++.h>
using namespace std;
struct prb {
  int a, t, id;
  bool operator<(const prb& b) const { return t < b.t; }
};
int n, T;
prb z[200010];
vector<int> sol;
bool solve(int k) {
  sol.clear();
  long long sumt = 0;
  for (int i = 0; i < n; i++) {
    if (z[i].a >= k && sol.size() < k) {
      sumt += z[i].t;
      sol.push_back(z[i].id);
    }
  }
  return sumt <= T && sol.size() == k;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> T;
  for (int i = 0; i < n; i++) {
    cin >> z[i].a >> z[i].t;
    z[i].id = i + 1;
  }
  sort(z, z + n);
  int lo = 1, hi = n, ans = 0;
  while (lo <= hi) {
    int mid = (lo + hi) / 2;
    if (solve(mid)) {
      ans = mid;
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  solve(ans);
  cout << ans << endl << ans << endl;
  for (int x : sol) cout << x << " ";
  cout << endl;
  return 0;
}
