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;
int n;
struct line {
  int s, m, e;
  int ind;
};
line lines[100003];
int middleSort[100003];
inline int sf(const line &a, const line &b) { return a.s < b.s; }
inline int msf(const int a, const int b) { return lines[a].m < lines[b].m; }
struct {
  int coverred;
  int maxCount;
  int maxCountFrom;
} segTree[524288 * 2];
void recalc(int s) {
  if (s >= 524288) return;
  int from = (s << 1) + 1;
  if (segTree[s << 1].maxCount > segTree[(s << 1) | 1].maxCount) {
    from = s << 1;
  }
  segTree[s].maxCount = segTree[s].coverred + segTree[from].maxCount;
  segTree[s].maxCountFrom = segTree[from].maxCountFrom;
}
void uncover(int s, int e, int count = 1) {
  s += 524288;
  e += 524288;
  int l = s, r = e;
  while (l <= r) {
    if (l & 1) {
      segTree[l].coverred -= count;
      segTree[l].maxCount -= count;
    }
    if (!(r & 1)) {
      segTree[r].coverred -= count;
      segTree[r].maxCount -= count;
    }
    l = (l + 1) >> 1;
    r = (r - 1) >> 1;
  }
  while (s >= 1) {
    recalc(s);
    if (s != e) recalc(e);
    s >>= 1;
    e >>= 1;
  }
}
void cover(int s, int e) { uncover(s, e, -1); }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &lines[i].s, &lines[i].m, &lines[i].e);
    lines[i].ind = i;
    middleSort[i] = i;
  }
  for (int i = 524288; i < 1048576; i++) {
    segTree[i].maxCountFrom = i - 524288;
  }
  for (int i = 524288 - 1; i >= 1; i--) {
    segTree[i].maxCountFrom = segTree[i << 1].maxCountFrom;
  }
  sort(lines, lines + n, sf);
  sort(middleSort, middleSort + n, msf);
  int ans = 0;
  int ansL = -1, ansR = -1;
  int j = 0;
  for (int i = 0; i < n; i++) {
    while (j < n && lines[middleSort[j]].m < lines[i].s) {
      uncover(lines[middleSort[j]].m, lines[middleSort[j]].e);
      j++;
    }
    cover(lines[i].m, lines[i].e);
    if (segTree[1].maxCount > ans) {
      ans = segTree[1].maxCount;
      ansL = lines[i].s;
      ansR = segTree[1].maxCountFrom;
    }
  }
  std::vector<int> ansSet;
  for (int i = 0; i < n; i++) {
    if (ansL <= lines[i].m && lines[i].m <= ansR && lines[i].s <= ansL &&
        ansR <= lines[i].e) {
      ansSet.push_back(lines[i].ind + 1);
    }
  }
  printf("%d\n", (int)ansSet.size());
  for (int i = 0; i < ansSet.size(); i++) {
    printf("%d%c", ansSet[i], i + 1 == ansSet.size() ? '\n' : ' ');
  }
  return 0;
}