#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const int N = 1 << 19;
int n;
int m;
pair<int, int> tree[2 * N + 10];
int add[2 * N + 10];
vector<pair<int, pair<int, int> > > v[300001];
int A[100000];
int B[100000];
int C[100000];
int push(int x, int l, int r) {
  if (add[x] != 0) {
    tree[x].first += add[x];
    if (l != r) {
      add[x * 2 + 1] += add[x];
      add[x * 2 + 2] += add[x];
    }
    add[x] = 0;
  }
  return 0;
}
pair<int, int> upd(int x, int l, int r, int lc, int rc, int y) {
  push(x, l, r);
  if (r < lc || l > rc) return tree[x];
  if (l >= lc && r <= rc) {
    add[x] += y;
    push(x, l, r);
    return tree[x];
  }
  int s = (l + r) / 2;
  return tree[x] = max(upd(x * 2 + 1, l, s, lc, rc, y),
                       upd(x * 2 + 2, s + 1, r, lc, rc, y));
}
int init(int x, int l, int r) {
  tree[x] = make_pair(0, l);
  if (l != r) {
    int s = (l + r) / 2;
    init(x * 2 + 1, l, s);
    init(x * 2 + 2, s + 1, r);
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    A[i] = a;
    B[i] = b;
    C[i] = c;
    v[a].push_back(make_pair(1, make_pair(b, c)));
    v[b + 1].push_back(make_pair(-1, make_pair(b, c)));
  }
  memset(tree, 0, sizeof(tree));
  memset(add, 0, sizeof(add));
  init(0, 0, N - 1);
  pair<int, pair<int, int> > ans = make_pair(0, make_pair(0, 0));
  for (int i = 1; i <= 300000; i++) {
    for (int j = 0; j < ((int)(v[i]).size()); j++)
      upd(0, 0, N - 1, v[i][j].second.first, v[i][j].second.second,
          v[i][j].first);
    pair<int, int> tmp = tree[0];
    ans = max(ans, make_pair(tmp.first, make_pair(i, tmp.second)));
  }
  printf("%d\n", ans.first);
  for (int i = 0; i < n; i++)
    if (A[i] <= ans.second.first && B[i] >= ans.second.first &&
        B[i] <= ans.second.second && C[i] >= ans.second.second)
      printf("%d ", i + 1);
  printf("\n");
  return 0;
}
