#include <bits/stdc++.h>
using namespace std;
int n, T, f = 0;
struct task {
  int time, down, num;
  bool operator<(const task &cmp) const {
    return make_pair(time, down) < make_pair(cmp.time, cmp.down);
  }
} a[200010];
vector<int> ans;
inline bool Try(const int &score) {
  vector<int> tasks;
  int time = T;
  for (int i = 1; i <= n && tasks.size() < score; ++i)
    if (a[i].down >= score && time >= a[i].time)
      tasks.push_back(a[i].num), time -= a[i].time;
  if (tasks.size() != score) return 0;
  ans = tasks;
  return 1;
}
int main() {
  scanf("%d%d", &n, &T);
  for (int i = 1; i <= n; ++i)
    scanf("%d%d", &a[i].down, &a[i].time), a[i].num = i;
  sort(a + 1, a + 1 + n);
  int l = 0, r = n;
  while (l < r) {
    int mid = (l + r) / 2;
    if (Try(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  Try(l);
  cout << ans.size() << '\n' << ans.size() << '\n';
  for (auto &i : ans) cout << i << ' ';
}
