#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int INF = 0x7F7F7F7F;
const int MOD = 1e9 + 7;
const double EPS = 1e-10;
const double PI = 2 * acos(0.0);
const int maxn = 2e5 + 66;
int a[maxn], t[maxn];
int main() {
  int n, T;
  while (scanf("%d %d", &n, &T) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d %d", &a[i], &t[i]);
    vector<int> ans;
    int low = 0, high = n;
    while (low < high) {
      int mid = (low + high + 1) >> 1;
      vector<pair<int, int> > tmp;
      for (int i = 1; i <= n; i++)
        if (a[i] >= mid) tmp.emplace_back(t[i], i);
      bool ok = false;
      int len = tmp.size();
      if (len >= mid) {
        sort(tmp.begin(), tmp.end());
        int sum = 0;
        for (int i = 0; i < mid; i++) sum += tmp[i].first;
        if (sum <= T) {
          ok = true;
          ans.resize(mid);
          for (int i = 0; i < mid; i++) ans[i] = tmp[i].second;
        }
      }
      if (ok)
        low = mid;
      else
        high = mid - 1;
    }
    int alen = ans.size();
    printf("%d\n%d\n", alen, alen);
    for (int i = 0; i < alen; i++) {
      if (i) putchar(' ');
      printf("%d", ans[i]);
    }
    puts("");
  }
  return 0;
}
