#include <bits/stdc++.h>
using namespace std;
int L[300010], R[300010], U[300010];
vector<pair<int, int> > a[300010], b[300010];
int ak[8 * 300010], it[8 * 300010], ah[8 * 300010], ans = 0x7f7f7f7f;
void update(int x, int l, int r, int u, int v, int k) {
  if (x == 0) return;
  if (l > v || r < u) return;
  if (u <= l && r <= v) {
    it[x] += k;
    ak[x] += k;
    if (!ah[x]) ah[x] = l;
    return;
  }
  int mid = (l + r) >> 1;
  update(x << 1, l, mid, u, v, k);
  update(x << 1 | 1, mid + 1, r, u, v, k);
  if (it[x << 1] > it[x << 1 | 1]) {
    it[x] = it[x << 1];
    ah[x] = ah[x << 1];
  } else {
    it[x] = it[x << 1 | 1];
    ah[x] = ah[x << 1 | 1];
  }
  it[x] += ak[x];
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &L[i], &U[i], &R[i]);
    a[U[i]].push_back(make_pair(L[i], U[i]));
    b[R[i]].push_back(make_pair(L[i], U[i]));
  }
  int res = 0;
  int ll = -1, rr = -1;
  for (int i = 1; i < 300010; i++) {
    int u = a[i].size();
    for (int j = 0; j < u; j++) {
      pair<int, int> v = a[i][j];
      update(1, 1, 300010 - 10, v.first, v.second, 1);
    }
    if (it[1] > res) {
      res = it[1];
      rr = i;
      ll = ah[1];
    }
    u = b[i].size();
    for (int j = 0; j < u; j++) {
      pair<int, int> v = b[i][j];
      update(1, 1, 300010 - 10, v.first, v.second, -1);
    }
  }
  printf("%d\n", res);
  for (int i = 0; i < n; i++)
    if (ll >= L[i] && ll <= U[i] && rr >= U[i] && rr <= R[i])
      printf("%d ", i + 1);
  return 0;
}
