#include <bits/stdc++.h>
using namespace std;
int n, k;
struct node {
  int a, t, id;
  bool operator<(const node& a1) const { return t < a1.t; }
} x[200005];
bool check(int d) {
  int i, j;
  int cnt = 0, tk = k;
  for (i = 1; i <= n; i++) {
    if (x[i].a < d) continue;
    if (x[i].t <= tk) {
      tk -= x[i].t;
      cnt++;
    }
  }
  if (cnt >= d)
    return 1;
  else
    return 0;
}
int main() {
  int i, j;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> x[i].a >> x[i].t;
    x[i].id = i;
  }
  sort(x + 1, x + 1 + n);
  int l = 0, r = n + 1, mid;
  while (l < r - 1) {
    mid = (l + r) >> 1;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  int ans = 0;
  if (check(r))
    ans = r;
  else if (check(l))
    ans = l;
  else {
    cout << "-1" << endl;
    return 0;
  }
  cout << ans << endl << ans << endl;
  int tk = ans;
  for (i = 1; i <= n; i++) {
    if (x[i].a < ans) continue;
    if (tk <= 0) break;
    cout << x[i].id << " ";
    tk--;
  }
  putchar('\n');
  return 0;
}
