#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, t;
  cin >> n >> t;
  pair<pair<long long, long long>, long long> p[n];
  for (long long i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    p[i] = {{-x, -y}, i};
  }
  sort(p, p + n);
  set<pair<long long, long long>> s;
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    long long x = -p[i].first.first;
    long long y = -p[i].first.second;
    long long in = p[i].second;
    if ((long long)s.size() > x) break;
    if (sum + y <= t && (long long)s.size() < x) {
      s.insert({y, in});
      sum += y;
      continue;
    }
    if ((long long)s.size() >= 1 && sum + y > t) {
      auto it = s.end();
      it--;
      if (it->first > y) {
        sum += (y - it->first);
        s.erase(it);
        s.insert({y, in});
      }
    }
  }
  cout << (long long)s.size() << "\n";
  cout << (long long)s.size() << "\n";
  for (auto it = s.begin(); it != s.end(); it++) cout << it->second + 1 << " ";
}
