#include <bits/stdc++.h>
using namespace std;
inline long long in() {
  int32_t x;
  scanf("%d", &x);
  return x;
}
inline long long lin() {
  long long x;
  scanf("%lld", &x);
  return x;
}
char ch[4000010];
inline string get() {
  scanf("%s", ch);
  return string(ch);
}
inline void read(long long *a, long long n) {
  for (long long i = 0; i < n; i++) a[i] = in();
}
template <class blank>
inline void out(blank x) {
  cout << x << "\n";
  exit(0);
}
template <class blank>
inline void smin(blank &a, blank b) {
  a = min(a, b);
}
template <class blank>
inline void smax(blank &a, blank b) {
  a = max(a, b);
}
const long long maxn = 1e5 + 10;
const long long maxm = 2e6 + 10;
const long long maxlg = 21;
const long long base = 29;
const long long mod = 1e9 + 7;
const long long inf = 2e18 + 10;
long long n, l[maxn], r[maxn], x[maxn];
vector<long long> L[3 * maxn], R[3 * maxn];
struct node {
  long long maxi, maxid, lazy;
  node() { maxi = maxid = lazy = 0; }
} stree[12 * maxn], empty;
inline node merge(node a, node b, long long val) {
  node ret;
  ret.maxi = max(a.maxi, b.maxi) + val;
  ret.maxid = a.maxi >= b.maxi ? a.maxid : b.maxid;
  ret.lazy = val;
  return ret;
}
inline void add(long long ql, long long qr, long long val, long long p = 0,
                long long l = 1, long long r = 300000) {
  if (stree[p].maxid == 0) stree[p].maxid = l;
  if (l > qr || r < ql) return;
  if (l >= ql && r <= qr) {
    stree[p].maxi += val, stree[p].lazy += val;
    return;
  }
  long long mid = (l + r) >> 1;
  add(ql, qr, val, 2 * p + 1, l, mid);
  add(ql, qr, val, 2 * p + 2, mid + 1, r);
  stree[p] = merge(stree[2 * p + 1], stree[2 * p + 2], stree[p].lazy);
}
inline node get(long long ql, long long qr, long long p = 0, long long l = 1,
                long long r = 300000) {
  if (stree[p].maxid == 0) stree[p].maxid = l;
  if (l > qr || r < ql) return empty;
  if (l >= ql && r <= qr) {
    return stree[p];
  }
  long long mid = (l + r) >> 1;
  return merge(get(ql, qr, 2 * p + 1, l, mid),
               get(ql, qr, 2 * p + 2, mid + 1, r), stree[p].lazy);
}
long long res = 0, Left, Right;
int32_t main() {
  long long n = in();
  for (long long i = 0; i < n; i++) {
    l[i] = in(), x[i] = in(), r[i] = in();
    L[l[i]].push_back(i), R[x[i]].push_back(i);
  }
  for (long long i = 1; i <= 300000; i++) {
    for (auto id : L[i]) add(x[id], r[id], 1);
    node ret = get(i, 300000);
    if (ret.maxi > res) {
      res = ret.maxi, Left = i, Right = ret.maxid;
    }
    for (auto id : R[i]) add(x[id], r[id], -1);
  }
  cout << res << "\n";
  for (long long i = 0; i < n; i++)
    if (l[i] <= Left && r[i] >= Right && x[i] >= Left && x[i] <= Right)
      cout << i + 1 << " ";
}
