#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, V = 1e6 + 10;
int mx, n, m;
struct node {
  int v, l, r;
} a[N];
struct upd {
  int x, y, val;
};
vector<upd> v[V];
struct Seg {
  int tag, s, p;
} t[V << 2];
void build(int k, int l, int r) {
  t[k].s = t[k].tag = 0;
  t[k].p = l;
  if (l == r) return;
  int mid = l + r >> 1;
  build((k << 1), l, mid);
  build((k << 1 | 1), mid + 1, r);
}
void add(int k, int val) {
  t[k].s += val;
  t[k].tag += val;
}
void push_down(int k) {
  if (!t[k].tag) return;
  add((k << 1), t[k].tag);
  add((k << 1 | 1), t[k].tag);
  t[k].tag = 0;
}
void push_up(int k) {
  t[k].s = max(t[(k << 1)].s, t[(k << 1 | 1)].s);
  t[k].p = (t[(k << 1)].s == t[k].s ? t[(k << 1)].p : t[(k << 1 | 1)].p);
}
void modify(int k, int l, int r, int x, int y, int val) {
  if (x <= l && r <= y) return add(k, val);
  push_down(k);
  int mid = l + r >> 1;
  if (x <= mid) modify((k << 1), l, mid, x, y, val);
  if (mid < y) modify((k << 1 | 1), mid + 1, r, x, y, val);
  push_up(k);
}
signed main() {
  scanf("%d", &n);
  int L = 0, R = 0, ans = 0;
  for (register int i = (1); i <= (n); ++i) {
    scanf("%d %d %d", &a[i].l, &a[i].v, &a[i].r);
    v[a[i].l].push_back((upd){a[i].v, a[i].r, 1});
    v[a[i].v + 1].push_back((upd){a[i].v, a[i].r, -1});
    mx = max(mx, a[i].r);
  }
  build(1, 1, mx);
  for (register int i = (1); i <= (mx); ++i) {
    int l = v[i].size() - 1;
    for (register int j = (0); j <= (l); ++j)
      modify(1, 1, mx, v[i][j].x, v[i][j].y, v[i][j].val);
    if (ans < t[1].s) ans = t[1].s, L = i, R = t[1].p;
  }
  printf("%d\n", ans);
  for (register int i = (1); i <= (n); ++i)
    if (a[i].l <= L && L <= a[i].v && a[i].v <= R && R <= a[i].r)
      printf("%d ", i);
  printf("\n");
  return 0;
}
