#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct SegmentTree {};
long long n, t;
pair<long long, long long> p[200005];
long long id[200005];
void input() {}
void solve() {}
signed main(signed argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> t;
  for (long long i = 1; i <= n; i++) {
    cin >> p[i].first >> p[i].second;
    id[i] = i;
  }
  sort(id + 1, id + n + 1,
       [&](long long x, long long y) { return p[x].second < p[y].second; });
  long long l = 0, r = n, ans = 0;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    long long cnt = 0;
    long long ti = t;
    for (long long i = 1; i <= n; i++) {
      if (p[id[i]].first >= mid && ti - p[id[i]].second >= 0) {
        ++cnt;
        ti -= p[id[i]].second;
      }
    }
    if (cnt >= mid) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  cout << ans << "\n";
  cout << ans << "\n";
  long long cnt = ans;
  for (long long i = 1; i <= n; ++i) {
    if (p[id[i]].first >= ans && t - p[id[i]].second >= 0) {
      --cnt;
      cout << id[i] << " ";
      t -= p[id[i]].second;
    }
    if (cnt == 0) break;
  }
  return 0;
}
