#include <bits/stdc++.h>
using namespace std;
const int INF = ~0U >> 1;
const int mx = 300000;
const int MAXN = 100005;
struct node {
  int l, v, r, id;
} a[MAXN], b[MAXN];
bool cmp(node a, node b) { return a.l < b.l; }
bool cmp2(node a, node b) { return a.v < b.v; }
int co[(mx << 2) + 5];
int Mx[(mx << 2) + 5];
int po[(mx << 2) + 5];
void pushup(int o) {
  if (Mx[o << 1] >= Mx[o << 1 | 1]) {
    Mx[o] = Mx[o << 1];
    po[o] = po[o << 1];
  } else {
    Mx[o] = Mx[o << 1 | 1];
    po[o] = po[o << 1 | 1];
  }
}
void pushdown(int o) {
  if (co[o] != 0) {
    co[o << 1] += co[o];
    co[o << 1 | 1] += co[o];
    Mx[o << 1] += co[o];
    Mx[o << 1 | 1] += co[o];
    co[o] = 0;
  }
}
void build(int l, int r, int o) {
  if (l == r) {
    po[o] = l;
    return;
  }
  int m = l + r >> 1;
  build(l, m, o << 1);
  build(m + 1, r, o << 1 | 1);
  pushup(o);
}
void update(int l, int r, int o, int L, int R, int v) {
  if (L <= l && r <= R) {
    Mx[o] += v;
    co[o] += v;
    return;
  }
  pushdown(o);
  int m = l + r >> 1;
  if (L <= m) update(l, m, o << 1, L, R, v);
  if (m < R) update(m + 1, r, o << 1 | 1, L, R, v);
  pushup(o);
}
vector<int> ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &a[i].l, &a[i].v, &a[i].r);
    a[i].id = i;
    b[i] = a[i];
  }
  sort(a + 1, a + n + 1, cmp);
  sort(b + 1, b + n + 1, cmp2);
  int it = 1, it2 = 1;
  int cnt = 0;
  int L, R;
  build(1, mx, 1);
  for (int i = 1; i <= mx; i++) {
    while (it <= n && a[it].l <= i) {
      update(1, mx, 1, a[it].v, a[it].r, 1);
      ++it;
    }
    int res = Mx[1];
    if (res > cnt) {
      cnt = res;
      L = i;
      R = po[1];
    }
    while (it2 <= n && b[it2].v <= i) {
      update(1, mx, 1, b[it2].v, b[it2].r, -1);
      ++it2;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i].l <= L && a[i].r >= R && a[i].v >= L && a[i].v <= R)
      ans.push_back(a[i].id);
  }
  L = ans.size();
  printf("%d\n", L);
  for (int i = 0; i < L; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}
