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 low[1500005], high[1500005], v[1500005], l[1500005], h[1500005], x[1500005],
    conf[1500005], t[1500005], id[1500005], add[1500005], r[1500005];
int n;
pair<int, int> ans, val[1500005];
void build(int x, int i, int j) {
  low[x] = i;
  high[x] = j;
  if (i == j) {
    val[x] = pair<int, int>(0, i);
    return;
  }
  int m = (i + j) / 2;
  build(x * 2, i, m);
  build(x * 2 + 1, m + 1, j);
  val[x] = pair<int, int>(0, i);
}
void down(int x) {
  val[x * 2].first += add[x];
  add[x * 2] += add[x];
  val[x * 2 + 1].first += add[x];
  add[x * 2 + 1] += add[x];
  add[x] = 0;
}
pair<int, int> Get(int x, int i, int j) {
  if (low[x] > j || high[x] < i) return pair<int, int>(0, 0);
  if (i <= low[x] && high[x] <= j) {
    return val[x];
  }
  down(x);
  return max(Get(x * 2, i, j), Get(x * 2 + 1, i, j));
}
void Update(int x, int i, int j, int v) {
  if (low[x] > j || high[x] < i) return;
  if (i <= low[x] && high[x] <= j) {
    val[x].first += v;
    add[x] += v;
    return;
  }
  down(x);
  Update(x * 2, i, j, v);
  Update(x * 2 + 1, i, j, v);
  val[x] = max(val[x * 2], val[x * 2 + 1]);
}
bool cmp(int i, int j) { return x[i] < x[j] || x[i] == x[j] && t[i] < t[j]; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%d%d%d", &l[i], &v[i], &r[i]);
  for (int i = 1; i <= n; i++) {
    x[i] = l[i];
    t[i] = 0;
    conf[i] = i;
    x[i + n] = v[i];
    t[i + n] = 1;
    conf[i + n] = i;
  }
  for (int i = 1; i <= 2 * n; i++) id[i] = i;
  sort(id + 1, id + 2 * n + 1, cmp);
  build(1, 1, 300000);
  int L;
  ans = pair<int, int>(0, 0);
  for (int it = 1; it <= 2 * n; it++) {
    int i = id[it];
    if (t[i] == 0) {
      Update(1, v[conf[i]], r[conf[i]], 1);
      pair<int, int> u = Get(1, 1, 300000);
      if (u > ans) {
        ans = u;
        L = x[i];
      }
    } else {
      pair<int, int> u = Get(1, 1, 300000);
      if (u > ans) {
        ans = u;
        L = x[i];
      }
      Update(1, v[conf[i]], r[conf[i]], -1);
    }
  }
  cout << ans.first << endl;
  for (int i = 1; i <= n; i++)
    if (l[i] <= L && L <= v[i] && v[i] <= ans.second && ans.second <= r[i])
      printf("%d ", i);
  return 0;
}