#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.141592653589793238462643l;
const int N = 1 << 19;
int t[2 * N], u[2 * N];
int lb[2 * N], rb[2 * N];
void upd(int l, int r, int d, int v = 0) {
  if (l >= rb[v] || r <= lb[v]) {
    return;
  }
  if (l <= lb[v] && r >= rb[v]) {
    u[v] += d;
    return;
  }
  u[2 * v + 1] += u[v];
  u[2 * v + 2] += u[v];
  u[v] = 0;
  upd(l, r, d, 2 * v + 1);
  upd(l, r, d, 2 * v + 2);
  t[v] = max(t[2 * v + 1] + u[2 * v + 1], t[2 * v + 2] + u[2 * v + 2]);
}
int l[N], v[N], r[N];
vector<int> l_[N], v_[N];
int main() {
  memset(t, 0, sizeof t);
  memset(u, 0, sizeof u);
  for (int i = 0; i < int(N); i++) {
    lb[N - 1 + i] = i;
    rb[N - 1 + i] = i + 1;
  }
  for (int i = int(N - 1) - 1; i >= 0; i--) {
    lb[i] = lb[2 * i + 1];
    rb[i] = rb[2 * i + 2];
  }
  int n;
  cin >> n;
  for (int i = 0; i < int(n); i++) {
    scanf("%d%d%d", &l[i], &v[i], &r[i]);
    l_[l[i]].push_back(i);
    v_[v[i]].push_back(i);
    r[i]++;
  }
  int ans = 0;
  int ansl = 0, ansr = 0;
  for (int i = int(N) - 1; i >= 0; i--) {
    for (int j = 0; j < int(v_[i].size()); j++) {
      upd(i, r[v_[i][j]], 1);
    }
    int cur = t[0] + u[0];
    if (cur > ans) {
      ans = cur;
      ansl = i;
      int v = 0;
      while (v < N - 1) {
        u[2 * v + 1] += u[v];
        u[2 * v + 2] += u[v];
        t[v] += u[v];
        u[v] = 0;
        v = 2 * v + 2;
        if (t[v] + u[v] < cur) {
          --v;
        }
      }
      ansr = v - N + 1;
    }
    for (int j = 0; j < int(l_[i].size()); j++) {
      upd(v[l_[i][j]], r[l_[i][j]], -1);
    }
  }
  cout << ans << endl;
  for (int i = 0; i < int(n); i++) {
    if (l[i] <= ansl && r[i] > ansr && v[i] >= ansl && v[i] <= ansr) {
      printf("%d ", i + 1);
    }
  }
  puts("");
  return 0;
}
