#include <bits/stdc++.h>
using namespace std;
const int N = 2100000;
long long mod = 1e9 + 7;
int power(int a, int p) {
  int r = 1, y = a;
  while (p) {
    if (p & 1) r = (1LL * r * y) % mod;
    p >>= 1;
    y = (1LL * y * y) % mod;
  }
  return r;
}
int ara[N];
vector<pair<pair<int, int>, int>> v;
int n, T;
bool possible(int k) {
  long long t = 0;
  long long cnt = 0;
  for (auto x : v) {
    if (x.first.second >= k) {
      cnt++;
      t += x.first.first;
    }
    if (cnt >= k) break;
  }
  if (cnt >= k && t <= T)
    return 1;
  else
    return 0;
}
vector<int> res;
void get_res(int k) {
  for (auto x : v) {
    if (x.first.second >= k) {
      res.push_back(x.second);
    }
    if (res.size() == k) break;
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> T;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back({pair<int, int>(b, a), i + 1});
  }
  sort(v.begin(), v.end());
  int l = 1, r = n;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (possible(mid))
      l = mid + 1;
    else
      r = mid - 1;
  }
  get_res(r);
  cout << r << endl;
  if (r == 0) return 0 * puts("0");
  cout << res.size() << endl;
  for (auto x : res) cout << x << " ";
  cout << endl;
}
