#include <bits/stdc++.h>
using namespace std;
int n;
struct line {
  int s, m, e;
  int ind;
};
line lines[100003];
int middleSort[100003];
inline int sf(const line &a, const line &b) { return a.s < b.s; }
inline int msf(const int a, const int b) { return lines[a].m < lines[b].m; }
struct {
  int coverred;
  int maxCount;
  int maxCountFrom;
} segTree[524288 * 2];
void recalc(int s) {
  if (s >= 524288) return;
  int from = (s << 1) + 1;
  if (segTree[s << 1].maxCount > segTree[(s << 1) | 1].maxCount) {
    from = s << 1;
  }
  segTree[s].maxCount = segTree[s].coverred + segTree[from].maxCount;
  segTree[s].maxCountFrom = segTree[from].maxCountFrom;
}
void uncover(int s, int e, int count = 1) {
  s += 524288;
  e += 524288;
  int l = s, r = e;
  while (l <= r) {
    if (l & 1) {
      segTree[l].coverred -= count;
      segTree[l].maxCount -= count;
    }
    if (!(r & 1)) {
      segTree[r].coverred -= count;
      segTree[r].maxCount -= count;
    }
    l = (l + 1) >> 1;
    r = (r - 1) >> 1;
  }
  while (s >= 1) {
    recalc(s);
    if (s != e) recalc(e);
    s >>= 1;
    e >>= 1;
  }
}
void cover(int s, int e) { uncover(s, e, -1); }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &lines[i].s, &lines[i].m, &lines[i].e);
    lines[i].ind = i;
    middleSort[i] = i;
  }
  for (int i = 524288; i < 1048576; i++) {
    segTree[i].maxCountFrom = i - 524288;
  }
  for (int i = 524288 - 1; i >= 1; i--) {
    segTree[i].maxCountFrom = segTree[i << 1].maxCountFrom;
  }
  sort(lines, lines + n, sf);
  sort(middleSort, middleSort + n, msf);
  int ans = 0;
  int ansL = -1, ansR = -1;
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && lines[middleSort[j]].m < lines[i].s) {
      uncover(lines[middleSort[j]].m, lines[middleSort[j]].e);
      j++;
    }
    cover(lines[i].m, lines[i].e);
    if (segTree[1].maxCount > ans) {
      ans = segTree[1].maxCount;
      ansL = lines[i].s;
      ansR = segTree[1].maxCountFrom;
    }
  }
  std::vector<int> ansSet;
  for (int i = 0; i < n; i++) {
    if (ansL <= lines[i].m && lines[i].m <= ansR && lines[i].s <= ansL &&
        ansR <= lines[i].e) {
      ansSet.push_back(lines[i].ind + 1);
    }
  }
  printf("%d\n", (int)ansSet.size());
  for (int i = 0; i < ansSet.size(); i++) {
    printf("%d%c", ansSet[i], i + 1 == ansSet.size() ? '\n' : ' ');
  }
  return 0;
}
