#include <bits/stdc++.h>
using namespace std;
struct ple {
  int l, v, r;
} p[100010];
int n, m, tot;
struct qes {
  int ty, l, r, x, id;
} q[200010];
struct seg_tre {
  struct node {
    int Max, flag;
  } tr[1200010];
  void pushdown(int p) {
    tr[(p << 1)].flag += tr[p].flag;
    tr[(p << 1)].Max += tr[p].flag;
    tr[((p << 1) + 1)].flag += tr[p].flag;
    tr[((p << 1) + 1)].Max += tr[p].flag;
    tr[p].flag = 0;
  }
  void updata(int p) {
    tr[p].Max = max(tr[(p << 1)].Max, tr[((p << 1) + 1)].Max);
  }
  void Cover(int p, int l, int r, int a, int b, int num) {
    if (l == a && r == b) {
      tr[p].flag += num;
      tr[p].Max += num;
      return;
    }
    if (tr[p].flag) pushdown(p);
    if (b <= ((l + r) >> 1))
      Cover((p << 1), l, ((l + r) >> 1), a, b, num);
    else if (a >= ((l + r) >> 1))
      Cover(((p << 1) + 1), ((l + r) >> 1), r, a, b, num);
    else {
      Cover((p << 1), l, ((l + r) >> 1), a, ((l + r) >> 1), num);
      Cover(((p << 1) + 1), ((l + r) >> 1), r, ((l + r) >> 1), b, num);
    }
    updata(p);
  }
  int GetMax(int Max) {
    int l = 1, r = m + 1, p = 1;
    for (;;) {
      if (l == r - 1) return l;
      if (tr[p].flag) pushdown(p);
      if (tr[(p << 1)].Max == Max)
        p = (p << 1), r = ((l + r) >> 1);
      else
        p = ((p << 1) + 1), l = ((l + r) >> 1);
    }
  }
} T;
bool b[100010];
void read(int &x) {
  char ch = getchar();
  int mark = 1;
  for (; ch != '-' && (ch < '0' || ch > '9'); ch = getchar())
    ;
  if (ch == '-') mark = -1, ch = getchar();
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
  x *= mark;
}
inline bool cmp(qes A, qes B) {
  if (A.x == B.x) return A.ty > B.ty;
  return A.x < B.x;
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    read(p[i].l);
    read(p[i].v);
    read(p[i].r);
    m = max(m, p[i].r);
    q[++tot].x = p[i].l;
    q[tot].ty = 1;
    q[tot].l = p[i].v;
    q[tot].r = p[i].r;
    q[tot].id = i;
    q[++tot].x = p[i].v;
    q[tot].ty = -1;
    q[tot].l = p[i].v;
    q[tot].r = p[i].r;
    q[tot].id = i;
  }
  sort(q + 1, q + tot + 1, cmp);
  int Max = 0;
  for (int i = 1; i <= tot; i++) {
    T.Cover(1, 1, m + 1, q[i].l, q[i].r + 1, q[i].ty);
    Max = max(Max, T.tr[1].Max);
  }
  printf("%d\n", Max);
  for (int i = 1; i <= tot; i++) {
    T.Cover(1, 1, m + 1, q[i].l, q[i].r + 1, q[i].ty);
    if (q[i].ty == 1)
      b[q[i].id] = 1;
    else
      b[q[i].id] = 0;
    if (Max == T.tr[1].Max) {
      int t = T.GetMax(Max);
      int c = 0;
      for (int j = 1; j <= n; j++)
        if (b[j] && p[j].v <= t && t <= p[j].r) {
          printf("%d", j);
          c++;
          if (c == Max)
            printf("\n");
          else
            printf(" ");
        }
      return 0;
    }
  }
  return 0;
}
