#include <bits/stdc++.h>
using namespace std;
const int N = 2e+5 + 5;
int T, n;
struct val {
  int a, t, idx;
};
val inp[N];
bool ispos(int k) {
  int x = 0, tsum = 0;
  for (int i = 1; i <= n; i++)
    if (inp[i].a >= k) {
      if (tsum + inp[i].t > T) break;
      x++;
      tsum += inp[i].t;
    }
  return x >= k;
}
bool comp(val i1, val i2) {
  if (i1.t == i2.t) {
    if (i1.a == i2.a) return i1.idx < i2.idx;
    return i1.a < i2.a;
  }
  return i1.t < i2.t;
}
int main() {
  cin >> n >> T;
  for (int i = 1; i <= n; i++) {
    cin >> inp[i].a >> inp[i].t;
    inp[i].idx = i;
  }
  sort(inp + 1, inp + n + 1, comp);
  int l = 1, r = n + 1;
  while (l < r) {
    int m = (l + r) / 2;
    if (ispos(m))
      l = m + 1;
    else
      r = m;
  }
  cout << l - 1 << "\n";
  l = l - 1;
  vector<int> ans;
  int tsum = 0;
  for (int i = 1; i <= n && ans.size() < l; i++)
    if (inp[i].a >= l) {
      if (tsum + inp[i].t > T) break;
      ans.push_back(inp[i].idx);
    }
  cout << ans.size() << "\n";
  for (auto it : ans) cout << it << " ";
  cout << "\n";
}
