#include <bits/stdc++.h>
using namespace std;
struct nade {
  int pos, tag, sum, l, r;
} tree[600005 * 2];
int n;
void puup(int x) {
  if (tree[x * 2].sum > tree[x * 2 + 1].sum) {
    tree[x].pos = tree[x * 2].pos;
    tree[x].sum = tree[x * 2].sum;
  } else {
    tree[x].pos = tree[x * 2 + 1].pos;
    tree[x].sum = tree[x * 2 + 1].sum;
  }
}
void pudo(int x) {
  tree[x * 2].tag += tree[x].tag;
  tree[x * 2].sum += tree[x].tag;
  tree[x * 2 + 1].tag += tree[x].tag;
  tree[x * 2 + 1].sum += tree[x].tag;
  tree[x].tag = 0;
}
void build(int x, int l, int r) {
  tree[x].l = l;
  tree[x].r = r;
  if (l == r) {
    tree[x].pos = l;
    return;
  }
  int mid = (l + r) / 2;
  build(x * 2, l, mid);
  build(x * 2 + 1, mid + 1, r);
  tree[x].pos = tree[x * 2].pos;
}
void add(int l, int r, int val, int x) {
  if (tree[x].l >= l && tree[x].r <= r) {
    tree[x].sum += val;
    tree[x].tag += val;
    return;
  }
  pudo(x);
  if (tree[x * 2].r >= l) add(l, r, val, x * 2);
  if (tree[x * 2 + 1].l <= r) add(l, r, val, x * 2 + 1);
  puup(x);
}
int l[200005], r[200005], v[200005];
struct node {
  int x, u, d;
  bool b;
} s[200005];
bool cmp(node a, node b) {
  if (a.x != b.x) return a.x < b.x;
  return a.b < b.b;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &l[i], &v[i], &r[i]);
    s[i * 2].x = l[i];
    s[i * 2].u = r[i];
    s[i * 2].d = v[i];
    s[i * 2].b = 0;
    s[i * 2 + 1].x = v[i];
    s[i * 2 + 1].u = r[i];
    s[i * 2 + 1].d = v[i];
    s[i * 2 + 1].b = 1;
  }
  build(1, 1, 3e5 + 1);
  sort(s, s + 2 * n, cmp);
  int ans = 0, ansp = 0, ansx = 0;
  for (int i = 0; i < n * 2; i++) {
    add(s[i].d, s[i].u, s[i].b ? -1 : 1, 1);
    if (tree[1].sum > ans) {
      ans = tree[1].sum;
      ansp = tree[1].pos;
      ansx = s[i].x;
    }
  }
  printf("%d\n", ans);
  for (int i = 0; i < n; i++)
    if (l[i] <= ansx && ansx <= v[i] && v[i] <= ansp && ansp <= r[i])
      printf("%d ", i + 1);
}
