Problem: Pavel is going to make a game of his dream. However, he knows that he can't make it on his own so he founded a development company and hired n workers of staff. Now he wants to pick n workers from the staff who will be directly responsible for developing a game.

Each worker has a certain skill level vi. Besides, each worker doesn't want to work with the one whose skill is very different. In other words, the i-th worker won't work with those whose skill is less than li, and with those whose skill is more than ri.

Pavel understands that the game of his dream isn't too hard to develop, so the worker with any skill will be equally useful. That's why he wants to pick a team of the maximum possible size. Help him pick such team.

Input

The first line contains a single integer n (1 ≤ n ≤ 105) — the number of workers Pavel hired.

Each of the following n lines contains three space-separated integers li, vi, ri (1 ≤ li ≤ vi ≤ ri ≤ 3·105) — the minimum skill value of the workers that the i-th worker can work with, the i-th worker's skill and the maximum skill value of the workers that the i-th worker can work with.

Output

In the first line print a single integer m — the number of workers Pavel must pick for developing the game.

In the next line print m space-separated integers — the numbers of the workers in any order.

If there are multiple optimal solutions, print any of them.

Examples

Input

4
2 8 9
1 4 7
3 6 8
5 8 10


Output

3
1 3 4


Input

6
3 5 16
1 6 11
4 8 12
7 9 16
2 10 14
8 13 15


Output

4
1 2 3 5

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
struct worker {
  int l, v, r, x;
  worker(int l = 0, int v = 0, int r = 0, int x = 0) : l(l), v(v), r(r), x(x) {}
  bool operator<(const worker &s) const { return l < s.l; }
};
struct node {
  int k, t, p;
  node(int k = 0, int t = 0, int p = 0) : k(k), t(t), p(p) {}
};
const int N_ = 100505;
const int MAXX = 300000;
int N;
worker D[N_];
int res = -1987654321;
priority_queue<pair<int, int>, vector<pair<int, int> >,
               greater<pair<int, int> > >
    PQ;
node Tree[1048577];
void spread(int nd) {
  int ch1 = nd + nd, ch2 = nd + nd + 1;
  Tree[ch1].k += Tree[nd].k;
  Tree[ch1].t += Tree[nd].k;
  Tree[ch2].k += Tree[nd].k;
  Tree[ch2].t += Tree[nd].k;
  Tree[nd].k = 0;
}
void update(int nd, int nl, int nr, int x, int y, int d) {
  node &here = Tree[nd];
  if (here.p == 0) Tree[nd].p = nl;
  if (nl == x && nr == y) {
    here.k += d;
    here.t += d;
  } else {
    int nmid = (nl + nr) >> 1;
    if (here.k != 0) spread(nd);
    if (x <= nmid) update(nd + nd, nl, nmid, x, min(y, nmid), d);
    if (nmid < y) update(nd + nd + 1, nmid + 1, nr, max(x, nmid + 1), y, d);
    int q = 0;
    if (Tree[nd + nd].t < Tree[nd + nd + 1].t) q = 1;
    here.t = Tree[nd + nd + q].t;
    here.p = Tree[nd + nd + q].p;
  }
}
void add(int w, int d) { update(1, 1, 524288, D[w].v, D[w].r, d); }
int solve() {
  int ret = 0;
  while (!PQ.empty()) PQ.pop();
  for (int x = 1, i = 1; x <= MAXX; x++) {
    while (i <= N && D[i].l <= x) {
      PQ.push(pair<int, int>(D[i].v, i));
      add(i++, 1);
    }
    while (!PQ.empty() && PQ.top().first < x) {
      add(PQ.top().second, -1);
      PQ.pop();
    }
    if (Tree[1].t == res) {
      printf("%d\n", res);
      while (!PQ.empty()) {
        int w = PQ.top().second;
        PQ.pop();
        if (D[w].v <= Tree[1].p && Tree[1].p <= D[w].r) printf("%d ", D[w].x);
      }
      exit(0);
    }
    ret = max(ret, Tree[1].t);
  }
  return ret;
}
int main() {
  int i, j, k;
  scanf("%d", &N);
  for (i = 1; i <= N; i++)
    scanf("%d%d%d", &D[i].l, &D[i].v, &D[i].r), D[i].x = i;
  sort(D + 1, D + N + 1);
  res = solve();
  solve();
  return 0;
}