#include <bits/stdc++.h>
using namespace std;
struct point {
  int l, r, p, id;
};
int low[2222222], high[2222222], mang[2222222], add[2222222];
int n, maxn;
point d[111111];
priority_queue<pair<int, int> > pq;
bool cmp(point u, point v) { return (u.p < v.p); }
void build(int s, int dau, int cuoi) {
  low[s] = dau;
  high[s] = cuoi;
  mang[s] = 0;
  add[s] = 0;
  if (dau != cuoi) {
    int mid = (dau + cuoi) / 2;
    build(s * 2, dau, mid);
    build(s * 2 + 1, mid + 1, cuoi);
  }
}
void down(int s) {
  mang[s * 2] += add[s];
  add[s * 2] += add[s];
  mang[s * 2 + 1] += add[s];
  add[s * 2 + 1] += add[s];
  add[s] = 0;
}
int found(int s) {
  if (low[s] == high[s])
    return low[s];
  else {
    down(s);
    if (mang[s * 2] > mang[s * 2 + 1])
      return found(s * 2);
    else
      return (found(s * 2 + 1));
  }
}
void push_it(int value, int dau, int cuoi, int s) {
  if ((dau <= low[s]) && (high[s] <= cuoi))
    add[s] += value, mang[s] += value;
  else {
    down(s);
    if (dau <= high[s * 2]) push_it(value, dau, cuoi, s * 2);
    if (cuoi > high[s * 2]) push_it(value, dau, cuoi, s * 2 + 1);
    mang[s] = max(mang[s * 2], mang[s * 2 + 1]);
  }
}
void push(int i) {
  push_it(1, d[i].l, d[i].p, 1);
  pq.push(make_pair(-d[i].r, i));
}
void rem(int i) { push_it(-1, d[i].l, d[i].p, 1); }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d%d%d", &d[i].l, &d[i].p, &d[i].r);
  for (int i = 1; i <= n; i++) d[i].id = i;
  sort(d + 1, d + n + 1, cmp);
  maxn = 0;
  for (int i = 1; i <= n; i++) maxn = max(maxn, d[i].r);
  int p = 1, l, r, ans = 0;
  build(1, 1, maxn);
  for (int i = 1; i <= maxn; i++) {
    while ((p <= n) && (i >= d[p].p)) push(p), p++;
    while ((!pq.empty()) && (-pq.top().first < i))
      rem(pq.top().second), pq.pop();
    if (mang[1] > ans) {
      ans = mang[1];
      l = found(1);
      r = i;
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++)
    if (d[i].p >= l)
      if (d[i].p <= r)
        if (d[i].l <= l)
          if (d[i].r >= r) printf("%d ", d[i].id);
  return 0;
}
