#include <bits/stdc++.h>
using namespace std;
template <typename T>
T read1() {
  T t = 0;
  char k;
  bool v = 0;
  do (k = getchar()) == '-' && (v = 1);
  while ('0' > k || k > '9');
  while ('0' <= k && k <= '9')
    t = (t << 3) + (t << 1) + (k ^ '0'), k = getchar();
  return v ? -t : t;
}
int v[1200005], s, fl[1200005], w[1200005];
vector<pair<int, pair<int, int> > > a[300005], b;
void down(int d) {
  fl[d << 1] += fl[d];
  fl[d << 1 | 1] += fl[d];
  v[d << 1] += fl[d];
  v[d << 1 | 1] += fl[d];
  fl[d] = 0;
}
void up(int d) {
  v[d << 1] > v[d << 1 | 1] ? (w[d] = w[d << 1], v[d] = v[d << 1])
                            : (w[d] = w[d << 1 | 1], v[d] = v[d << 1 | 1]);
}
void add(int l, int r, int x, int y, int z, int d) {
  if (l == x && r == y) {
    v[d] += z, fl[d] += z;
    return;
  }
  down(d);
  int mid = l + r >> 1;
  if (y <= mid)
    add(l, mid, x, y, z, d << 1);
  else if (mid < x)
    add(mid + 1, r, x, y, z, d << 1 | 1);
  else
    add(l, mid, x, mid, z, d << 1), add(mid + 1, r, mid + 1, y, z, d << 1 | 1);
  up(d);
}
void build(int l, int r, int d) {
  if (l == r)
    w[d] = l;
  else {
    build(l, l + r >> 1, d << 1);
    build(l + r + 2 >> 1, r, d << 1 | 1);
    w[d] = w[d << 1];
  }
}
int wh, g;
int main() {
  s = read1<long long>();
  build(1, 300000, 1);
  for (int i = 1; i <= s; ++i) {
    int l = read1<long long>(), v = read1<long long>(), r = read1<long long>();
    b.push_back(make_pair(l, make_pair(v, r)));
    a[l].push_back(make_pair(1, make_pair(v, r)));
    a[v + 1].push_back(make_pair(-1, make_pair(v, r)));
  }
  int ans = 0;
  for (int i = 1; i <= 300000; ++i) {
    for (int j = 0; j < a[i].size(); ++j)
      add(1, 300000, a[i][j].second.first, a[i][j].second.second, a[i][j].first,
          1);
    if (v[1] > ans) ans = v[1], wh = i, g = w[1];
  }
  cout << ans << endl;
  for (int i = 0; i < s; ++i)
    if (b[i].first <= wh && wh <= b[i].second.first && b[i].second.first <= g &&
        g <= b[i].second.second)
      printf("%d ", i + 1);
  return 0;
}
