#include <bits/stdc++.h>
template <class T>
inline T read(const T sample) {
  T x = 0;
  int f = 1;
  char s;
  while ((s = getchar()) > '9' || s < '0')
    if (s == '-') f = -1;
  while (s >= '0' && s <= '9')
    x = (x << 1) + (x << 3) + (s ^ 48), s = getchar();
  return x * f;
}
template <class T>
inline void write(const T x) {
  if (x < 0) return (void)(putchar('-'), write(-x));
  if (x > 9) write(x / 10);
  putchar(x % 10 ^ 48);
}
template <class T>
inline T Max(const T x, const T y) {
  return x > y ? x : y;
}
template <class T>
inline T Min(const T x, const T y) {
  return x < y ? x : y;
}
template <class T>
inline T fab(const T x) {
  return x > 0 ? x : -x;
}
template <class T>
inline T Gcd(const T x, const T y) {
  return y ? Gcd(y, x % y) : x;
}
using namespace std;
const int N = 1e5 + 5, lim = 3e5;
int n, cnt, x[N], y[N], z[N], t[lim << 2], pos[lim << 2], la[lim << 2], ans;
struct node {
  int l, r, k;
  bool op;
} s[N << 1];
bool cmp(node x, node y) {
  if (x.k ^ y.k) return x.k < y.k;
  return x.op < y.op;
}
void build(int o, int l, int r) {
  if (l == r) {
    pos[o] = l;
    return;
  }
  int mid = l + r >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  pos[o] = pos[o << 1];
}
void pushDown(int o) {
  if (!la[o]) return;
  la[o << 1] += la[o], la[o << 1 | 1] += la[o];
  t[o << 1] += la[o], t[o << 1 | 1] += la[o];
  la[o] = 0;
}
void pushUp(int o) {
  if (t[o << 1] > t[o << 1 | 1])
    t[o] = t[o << 1], pos[o] = pos[o << 1];
  else
    t[o] = t[o << 1 | 1], pos[o] = pos[o << 1 | 1];
}
void modify(int o, int l, int r, int L, int R, int k) {
  if (l > R || r < L) return;
  if (l >= L && r <= R) {
    t[o] += k, la[o] += k;
    return;
  }
  int mid = l + r >> 1;
  pushDown(o);
  modify(o << 1, l, mid, L, R, k);
  modify(o << 1 | 1, mid + 1, r, L, R, k);
  pushUp(o);
}
int main() {
  int L, R;
  n = read(9);
  for (register signed i = (1), _end = (n); i <= _end; ++i) {
    x[i] = read(9), y[i] = read(9), z[i] = read(9);
    s[++cnt] = (node){y[i], z[i], x[i], 0};
    s[++cnt] = (node){y[i], z[i], y[i], 1};
  }
  sort(s + 1, s + cnt + 1, cmp);
  build(1, 1, lim);
  for (register signed i = (1), _end = (cnt); i <= _end; ++i) {
    modify(1, 1, lim, s[i].l, s[i].r, s[i].op ? -1 : 1);
    if (t[1] > ans) {
      ans = t[1];
      L = s[i].k, R = pos[1];
    }
  }
  write(ans), putchar('\n');
  for (register signed i = (1), _end = (n); i <= _end; ++i)
    if (x[i] <= L && L <= y[i] && y[i] <= R && R <= z[i])
      write(i), putchar(' ');
  puts("");
  return 0;
}
