#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T abs(T t) {
  return t < 0 ? -t : t;
}
const long long modn = 1000000007;
inline long long mod(long long x) { return x % modn; }
const int MAXN = 212345;
int n, m, k;
long long t;
pair<int, int> s[MAXN];
int ind[MAXN];
bool cmp(int a, int b) { return s[a].second < s[b].second; }
int go(int m) {
  long long res = t;
  int cnt = 0;
  for (int ii = 0; ii < n; ii++) {
    int i = ind[ii];
    if (s[i].first < m || s[i].second > res) continue;
    res -= s[i].second;
    cnt++;
  }
  return (cnt >= m);
}
vector<int> ans;
void print(int m) {
  long long res = t;
  int cnt = 0;
  for (int ii = 0; ii < n; ii++) {
    int i = ind[ii];
    if (s[i].first < m || s[i].second > res) continue;
    res -= s[i].second;
    if (cnt < m) {
      ans.push_back(i);
      cnt++;
    }
  }
  printf("%d\n", cnt);
  for (int i = 0; i < ans.size(); i++) {
    printf("%d ", ans[i] + 1);
  }
  puts("");
}
int main() {
  scanf("%d%lld", &n, &t);
  for (int a = 0; a < n; a++) {
    scanf("%d %d", &s[a].first, &s[a].second);
    ind[a] = a;
  }
  sort(ind, ind + n, cmp);
  int i = 0, j = n;
  while (i < j) {
    int m = (i + j + 1) / 2;
    if (go(m))
      i = m;
    else
      j = m - 1;
  }
  printf("%d\n", i);
  print(i);
}
