#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, v, r, opt;
  node() {}
  node(int L, int V, int R, int T) { l = L, v = V, r = R, opt = T; }
} p[300005];
int t[300005 << 2], lazy[300005 << 2], pos[300005 << 2];
bool cmp(node x, node y) {
  if (x.l != y.l)
    return x.l < y.l;
  else
    return x.opt < y.opt;
}
void build(int num, int l, int r) {
  if (l == r) {
    pos[num] = l;
    return;
  }
  int mid = (l + r) >> 1;
  build(num << 1, l, mid), build(num << 1 | 1, mid + 1, r);
  pos[num] = pos[num << 1];
}
void pushdown(int num) {
  t[num << 1] += lazy[num], t[num << 1 | 1] += lazy[num];
  lazy[num << 1] += lazy[num], lazy[num << 1 | 1] += lazy[num];
  lazy[num] = 0;
}
void modify(int num, int l, int r, int L, int R, int val) {
  if (L <= l && r <= R) {
    t[num] += val, lazy[num] += val;
    return;
  }
  pushdown(num);
  int mid = (l + r) >> 1;
  if (L <= mid && l <= R) modify(num << 1, l, mid, L, R, val);
  if (mid < R && r >= L) modify(num << 1 | 1, mid + 1, r, L, R, val);
  if (t[num << 1] > t[num << 1 | 1])
    t[num] = t[num << 1], pos[num] = pos[num << 1];
  else
    t[num] = t[num << 1 | 1], pos[num] = pos[num << 1 | 1];
}
int n, cnt, ans, ansp, idx;
int l[300005], r[300005], v[300005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d %d %d", &l[i], &v[i], &r[i]);
    p[++cnt] = node(l[i], v[i], r[i], 0);
    p[++cnt] = node(v[i], v[i], r[i], 1);
  }
  build(1, 1, 3e5);
  sort(p + 1, p + cnt + 1, cmp);
  for (int i = 1; i <= cnt; i++) {
    modify(1, 1, 3e5, p[i].v, p[i].r, p[i].opt ? -1 : 1);
    if (t[1] > ans) ans = t[1], ansp = pos[1], idx = p[i].l;
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; i++)
    if (l[i] <= idx && idx <= v[i] && v[i] <= ansp && ansp <= r[i])
      printf("%d ", i);
  return 0;
}
