#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
int ans[maxn];
struct Record {
  int l, v, r, id;
} a[maxn], b[maxn];
struct Tree {
  int l, r, chg, opt;
  Tree *lc, *rc;
  Tree(int _l, int _r) : l(_l), r(_r) {
    chg = opt = 0;
    lc = l + 1 < r ? new Tree(l, (l + r) >> 1) : NULL;
    rc = l + 1 < r ? new Tree((l + r) >> 1, r) : NULL;
  }
  void down() {
    lc->chg += chg;
    lc->opt += chg;
    rc->chg += chg;
    rc->opt += chg;
    chg = 0;
  }
  int query(int ll, int rr) {
    if (ll <= l && rr >= r) return opt;
    if (chg) down();
    int res = 0;
    if (ll < (l + r) >> 1) res = max(res, lc->query(ll, rr));
    if (rr > (l + r) >> 1) res = max(res, rc->query(ll, rr));
    opt = max(lc->opt, rc->opt);
    return res;
  }
  void change(int ll, int rr, int x) {
    if (ll <= l && rr >= r) {
      chg += x;
      opt += x;
      return;
    }
    down();
    if (ll < (l + r) >> 1) lc->change(ll, rr, x);
    if (rr > (l + r) >> 1) rc->change(ll, rr, x);
    opt = max(lc->opt, rc->opt);
  }
  void clear() {
    chg = opt = 0;
    if (lc != NULL) lc->clear();
    if (rc != NULL) rc->clear();
  }
  int which(int ll, int rr, int x) {
    if (l + 1 == r) return l + 1;
    if (chg) down();
    if (ll < (l + r) >> 1 && lc->query(ll, rr) == x)
      return lc->which(ll, rr, x);
    return rc->which(ll, rr, x);
  }
} * root;
bool cmp_l(Record u, Record v) { return u.l < v.l; }
bool cmp_v(Record u, Record v) { return u.v < v.v; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].l >> a[i].v >> a[i].r;
    a[i].id = i;
    b[i] = a[i];
  }
  sort(a, a + n, cmp_l);
  sort(b, b + n, cmp_v);
  root = new Tree(0, 300000);
  int res = 0;
  for (int i = 0, k = 0; i < n; i++) {
    for (; k < n && b[k].v < a[i].l; k++) root->change(b[k].v - 1, b[k].r, -1);
    root->change(a[i].v - 1, a[i].r, 1);
    res = max(res, root->query(a[i].l - 1, 300000));
  }
  root->clear();
  for (int i = 0, k = 0; i < n; i++) {
    for (; k < n && b[k].v < a[i].l; k++) root->change(b[k].v - 1, b[k].r, -1);
    root->change(a[i].v - 1, a[i].r, 1);
    if (res == root->query(a[i].l - 1, 300000)) {
      int whi = root->which(a[i].l - 1, 300000, res);
      memset(ans, 0, sizeof(ans));
      for (int j = 0; j <= i; j++)
        if (a[j].v <= whi && a[j].r >= whi && a[j].v >= a[i].l)
          ans[a[j].id] = 1;
      cout << res << endl;
      for (int j = 0; j < n; j++)
        if (ans[j]) cout << j + 1 << ' ';
      cout << endl;
      break;
    }
  }
  return 0;
}
