#include <bits/stdc++.h>
using namespace std;
const int m = 1e9 + 7;
const int N = 3e5 + 15;
const int64_t INF = 100000000000000018LL;
vector<vector<long long>> graph(N);
vector<long long> collect;
map<long long, long long> mpp;
set<pair<long long, long long>> s;
set<long long> second;
long long odd = 0, even = 0;
long long pow(long long a, long long b, long long m) {
  long long ans = 1;
  while (b) {
    if (b & 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans;
}
long long visited[N];
long long cnt = 0;
void dfs(long long ind, long long col) {
  visited[ind] = true;
  if (col != mpp[ind]) cnt++;
  visited[ind] = 1;
  for (auto it : graph[ind]) {
    {
      if (!visited[it]) dfs(it, mpp[ind]);
    }
  }
}
bool isPowerOfTwo(long long n) {
  if (n == 0) return false;
  return (ceil(log2(n)) == floor(log2(n)));
}
void solve() {
  long long n, T, i;
  cin >> n >> T;
  long long a[n + 1];
  vector<pair<long long, long long>> v(n + 1);
  for (i = 1; i <= n; i++) {
    cin >> v[i].first >> a[i];
    v[i].second = i;
  }
  long long l = 1, r = n, mid, cnt = 0, ans = -1;
  while (l <= r) {
    mid = l + (r - l) / 2;
    vector<long long> yoyo;
    for (i = 1; i <= n; i++) {
      if (v[i].first >= mid) yoyo.push_back(a[i]);
    }
    sort((yoyo).begin(), (yoyo).end());
    if ((long long)yoyo.size() < mid) {
      r = mid - 1;
    } else {
      long long k = 0, sum = 0, f = 0;
      for (i = 0; i < (long long)yoyo.size(); i++) {
        sum += yoyo[i];
        if (sum <= T) {
          k++;
        }
      }
      if (k >= mid) {
        ans = mid;
        l = mid + 1;
      } else
        r = mid - 1;
    }
  }
  if (ans == -1) {
    cout << 0 << "\n";
    cout << 0 << "\n";
    return;
  }
  cout << ans << "\n";
  cout << ans << "\n";
  vector<pair<long long, long long>> aa;
  for (i = 1; i <= n; i++) {
    if (v[i].first >= ans) aa.push_back({a[i], i});
  }
  sort((aa).begin(), (aa).end());
  for (i = 0; i < ans; i++) cout << aa[i].second << " ";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
}
