#include <bits/stdc++.h>
using namespace std;
struct Foo {
  unsigned long long t;
  int a, id;
  Foo(int a, unsigned long long t, int id) : a(a), t(t), id(id) {}
  bool operator<(const Foo &rhs) const { return a > rhs.a; }
};
struct Bar {
  unsigned long long t;
  int a, id;
  Bar(int a, unsigned long long t, int id) : a(a), t(t), id(id) {}
  bool operator<(const Bar &rhs) const { return t > rhs.t; }
};
const int maxn = 2e5 + 5;
int a[maxn];
unsigned long long t[maxn];
int main(void) {
  int n;
  unsigned long long T;
  while (~scanf("%d%llu", &n, &T)) {
    int ans = 0;
    priority_queue<Foo> foo;
    priority_queue<Bar> bar;
    for (int i = 0; i < n; ++i) {
      scanf("%d%llu", a + i, t + i);
      bar.push(Bar(a[i], t[i], i));
    }
    unsigned long long cur = 0;
    for (int k = 1; k <= n; ++k) {
      while (!foo.empty() && foo.top().a < k) cur -= foo.top().t, foo.pop();
      while (foo.size() < k && !bar.empty()) {
        Bar b = bar.top();
        bar.pop();
        if (b.a < k) continue;
        foo.push(Foo(b.a, b.t, b.id)), cur += b.t;
      }
      if (foo.size() < k) break;
      if (cur <= T) ans = k;
    }
    printf("%d\n%d\n", ans, ans);
    foo = priority_queue<Foo>();
    bar = priority_queue<Bar>();
    for (int i = 0; i < n; ++i) bar.push(Bar(a[i], t[i], i));
    for (int k = 1; k <= ans; ++k) {
      while (!foo.empty() && foo.top().a < k) cur -= foo.top().t, foo.pop();
      while (foo.size() < k && !bar.empty()) {
        Bar b = bar.top();
        bar.pop();
        if (b.a < k) continue;
        foo.push(Foo(b.a, b.t, b.id)), cur += b.t;
      }
      if (foo.size() < k) break;
    }
    bool is_first = true;
    while (!foo.empty()) {
      Foo f = foo.top();
      foo.pop();
      if (is_first)
        is_first = false;
      else
        putchar(' ');
      printf("%d", f.id + 1);
    }
    puts("");
  }
  return 0;
}
