#include <bits/stdc++.h>
using namespace std;
const int mn = 2e5 + 5;
int n, L;
vector<int> dans;
struct node {
  int time, ai, id;
  bool operator<(const node &rhs) const { return time < rhs.time; }
} p[mn];
bool c(int x) {
  int t = 0, s = 0;
  for (int i = 1; i <= n; i++) {
    if (p[i].ai >= x) s++, t += p[i].time;
    if (s == x) break;
  }
  return s == x && t <= L;
}
void get(int x) {
  int t = 0, s = 0;
  for (int i = 1; i <= n; i++) {
    if (p[i].ai >= x) s++, t += p[i].time, dans.push_back(p[i].id);
    ;
    if (s == x) break;
  }
  return;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n >> L;
  for (int i = 1; i <= n; i++) cin >> p[i].ai >> p[i].time, p[i].id = i;
  sort(p + 1, p + n + 1);
  int l = 1, r = n;
  int ans = 0;
  while (l <= r) {
    int mid = l + r >> 1;
    if (c(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  if (ans) get(ans);
  cout << ans << "\n" << ans << "\n";
  if (ans)
    for (auto &i : dans) cout << i << " ";
  cout << endl;
  return 0;
}
