#include <bits/stdc++.h>
using namespace std;
int mini(int a, int b) {
  if (a < b) return a;
  return b;
}
int maxi(int a, int b) {
  if (a > b) return a;
  return b;
}
int n, L[300100], V[300100], R[300100];
struct event {
  int type, val, ind;
  event() {}
  event(int _t, int _val, int _ind) { type = _t, val = _val, ind = _ind; }
};
event E[2 * 300100];
int ce = 0;
bool comp(event a, event b) {
  if (a.val == b.val) return a.type < b.type;
  return a.val < b.val;
}
struct tree {
  int mx, ind, rem;
};
tree T[4 * 300100];
void init(int node, int b, int e);
void update(int node, int b, int e, int k, int l, int add);
int main() {
  int i, j, k, l, test, t = 1;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d %d %d", &L[i], &V[i], &R[i]);
    E[ce++] = event(1, L[i], i);
    E[ce++] = event(2, V[i], i);
  }
  sort(E, E + ce, comp);
  init(1, 1, 300000);
  int ans = 0, ansl, ansr;
  for (i = 0; i < ce; i++) {
    event curr = E[i];
    int piv = E[i].ind;
    k = V[piv], l = R[piv];
    if (curr.type == 1) {
      update(1, 1, 300000, k, l, 1);
      if (T[1].mx > ans) {
        ans = T[1].mx;
        ansl = E[i].val;
        ansr = T[1].ind;
      }
    } else {
      update(1, 1, 300000, k, l, -1);
    }
  }
  printf("%d\n", ans);
  bool space = 0;
  for (i = 1; i <= n; i++) {
    if (L[i] <= ansl && ansl <= V[i] && V[i] <= ansr && ansr <= R[i]) {
      if (space) printf(" ");
      space = 1;
      printf("%d", i);
    }
  }
  puts("");
  return 0;
}
void update(int node, int b, int e, int k, int l, int rem) {
  if (b == e) {
    T[node].ind = b;
    T[node].mx += rem;
    T[node].rem = 0;
    return;
  }
  if (b == k && e == l) {
    T[node].rem += rem;
    T[node].mx += rem;
    return;
  }
  int left, right, mid;
  left = node << 1, right = left + 1, mid = (b + e) / 2;
  if (T[node].rem) {
    update(left, b, mid, b, mid, T[node].rem);
    update(right, mid + 1, e, mid + 1, e, T[node].rem);
    T[node].rem = 0;
  }
  if (l <= mid)
    update(left, b, mid, k, l, rem);
  else if (k > mid)
    update(right, mid + 1, e, k, l, rem);
  else {
    update(left, b, mid, k, mid, rem);
    update(right, mid + 1, e, mid + 1, l, rem);
  }
  if (T[left].mx > T[right].mx) {
    T[node].mx = T[left].mx;
    T[node].ind = T[left].ind;
  } else {
    T[node].mx = T[right].mx;
    T[node].ind = T[right].ind;
  }
}
void init(int node, int b, int e) {
  if (b == e) {
    T[node].ind = b;
    T[node].mx = 0;
    T[node].rem = 0;
    return;
  }
  int left, right, mid;
  left = node << 1, right = left + 1, mid = (b + e) / 2;
  init(left, b, mid);
  init(right, mid + 1, e);
  T[node] = T[left];
}
