#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
template <typename T>
T getint() {
  T val = 0;
  char c;
  while ((c = getchar()) && !(c >= '0' && c <= '9'))
    ;
  do {
    val = (val * 10) + c - '0';
  } while ((c = getchar()) && (c >= '0' && c <= '9'));
  return val;
}
vector<pair<long long, long long>> t;
int main() {
  long long n, T;
  n = getint<long long>();
  T = getint<long long>();
  t = vector<pair<long long, long long>>(n);
  for (int i = 0; i < n; ++i) {
    t[i].first = getint<long long>();
    t[i].second = getint<long long>();
  }
  long long L = 0, R = n;
  while (L < R) {
    long long mid = (L + R + 1) / 2;
    vector<long long> lst;
    for (int i = 0; i < n; ++i) {
      if (t[i].first >= mid) lst.push_back(t[i].second);
    }
    if ((int)(lst).size() < mid) {
      R = mid - 1;
      continue;
    }
    sort(lst.begin(), lst.end());
    long long akt = T;
    for (int i = 0; i < mid && akt >= 0; ++i) {
      akt -= lst[i];
    }
    if (akt >= 0) {
      L = mid;
    } else {
      R = mid - 1;
    }
  }
  vector<pair<long long, long long>> ans;
  for (int i = 0; i < n; ++i) {
    if (t[i].first >= L) ans.push_back({t[i].second, i});
  }
  sort((ans).begin(), (ans).end());
  cout << L << "\n";
  cout << L << "\n";
  for (int i = 0; i < L; ++i) cout << ans[i].second + 1 << " ";
  cout << "\n";
  return 0;
}
