#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
struct node {
  int x, y, z;
} d[N];
int n, T, a[N], b[N], c[N], e[N];
int Write[20], WRI;
void judge() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
int read() {
  int d = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') d = d * 10 + c - 48, c = getchar();
  return d * f;
}
void write(int x) {
  if (!x) {
    putchar('0');
    return;
  }
  if (x < 0) putchar('-'), x = -x;
  for (WRI = 1; x; x /= 10, WRI++) Write[WRI] = x % 10;
  for (int i = WRI - 1; i; i--) putchar((char)(Write[i] + 48));
}
bool check(int x) {
  int m = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] >= x) c[++m] = b[i];
  sort(c + 1, c + 1 + m);
  int res = 0, s = T;
  for (int i = 1; i <= m; i++)
    if (c[i] > s)
      break;
    else
      s -= c[i], res++;
  return res >= x;
}
bool cmp(node a, node b) { return a.z < b.z || a.z == b.z && a.y < b.y; }
int main() {
  n = read();
  T = read();
  for (int i = 1; i <= n; i++) a[i] = read(), b[i] = read();
  int l = 0, r = n, ans = 0;
  while (l <= r) {
    int mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  printf("%d\n%d\n", ans, ans);
  int m = 0;
  for (int i = 1; i <= n; i++) d[i] = (node){i, a[i], b[i]};
  sort(d + 1, d + 1 + n, cmp);
  int k = 0;
  for (int i = 1; i <= n && k < ans; i++)
    if (d[i].y >= ans) printf("%d ", d[i].x), k++;
  return 0;
}
