#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n, t;
pair<int, int> arr[maxn];
set<pair<int, int>> s;
int f(int k) {
  int sum = 0;
  for (int i = 0; i < n; i++) {
    if (arr[i].first >= k) {
      s.insert({arr[i].second, i});
      sum += arr[i].second;
    }
    if (s.size() > k) {
      auto it = s.end();
      it--;
      auto x = *(it);
      sum -= x.first;
      s.erase(it);
    }
  }
  return sum;
}
bool check(int k) {
  int sum = f(k);
  if (s.size() < k || sum > t) {
    return false;
  }
  return true;
}
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> arr[i].first >> arr[i].second;
  }
  int l = 0, r = n + 1;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid;
    }
    s.clear();
  }
  cout << l << "\n" << l << "\n";
  f(l);
  for (auto i = s.begin(); i != s.end(); i++) {
    auto x = *(i);
    cout << x.second + 1 << " ";
  }
  return 0;
}
