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;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
const int N = 1 << 19;
int n;
int m;
pair<int, int> tree[2 * N + 10];
int add[2 * N + 10];
vector<pair<int, pair<int, int> > > v[300001];
int A[100000];
int B[100000];
int C[100000];
int push(int x, int l, int r) {
  if (add[x] != 0) {
    tree[x].first += add[x];
    if (l != r) {
      add[x * 2 + 1] += add[x];
      add[x * 2 + 2] += add[x];
    }
    add[x] = 0;
  }
  return 0;
}
pair<int, int> upd(int x, int l, int r, int lc, int rc, int y) {
  push(x, l, r);
  if (r < lc || l > rc) return tree[x];
  if (l >= lc && r <= rc) {
    add[x] += y;
    push(x, l, r);
    return tree[x];
  }
  int s = (l + r) / 2;
  return tree[x] = max(upd(x * 2 + 1, l, s, lc, rc, y),
                       upd(x * 2 + 2, s + 1, r, lc, rc, y));
}
int init(int x, int l, int r) {
  tree[x] = make_pair(0, l);
  if (l != r) {
    int s = (l + r) / 2;
    init(x * 2 + 1, l, s);
    init(x * 2 + 2, s + 1, r);
  }
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    A[i] = a;
    B[i] = b;
    C[i] = c;
    v[a].push_back(make_pair(1, make_pair(b, c)));
    v[b + 1].push_back(make_pair(-1, make_pair(b, c)));
  }
  memset(tree, 0, sizeof(tree));
  memset(add, 0, sizeof(add));
  init(0, 0, N - 1);
  pair<int, pair<int, int> > ans = make_pair(0, make_pair(0, 0));
  for (int i = 1; i <= 300000; i++) {
    for (int j = 0; j < ((int)(v[i]).size()); j++)
      upd(0, 0, N - 1, v[i][j].second.first, v[i][j].second.second,
          v[i][j].first);
    pair<int, int> tmp = tree[0];
    ans = max(ans, make_pair(tmp.first, make_pair(i, tmp.second)));
  }
  printf("%d\n", ans.first);
  for (int i = 0; i < n; i++)
    if (A[i] <= ans.second.first && B[i] >= ans.second.first &&
        B[i] <= ans.second.second && C[i] >= ans.second.second)
      printf("%d ", i + 1);
  printf("\n");
  return 0;
}