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;
int64_t n;
int64_t N;
const int64_t MAX = 100500;
const int64_t SIZE = 300500 * 4;
int64_t storage[SIZE];
pair<int64_t, int64_t> st[SIZE];
void update(int64_t index, int64_t l, int64_t r, int64_t left, int64_t right,
            int64_t value) {
  if (r <= left || right <= l) return;
  if (left <= l && r <= right) {
    storage[index] += value;
    if (N <= index) {
      st[index] = make_pair(storage[index], index - N);
      return;
    }
    st[index] = max(st[index * 2 + 0], st[index * 2 + 1]);
    st[index].first += storage[index];
    return;
  }
  int64_t mid = (l + r) >> 1;
  update(index * 2 + 0, l, mid, left, right, value);
  update(index * 2 + 1, mid, r, left, right, value);
  st[index] = max(st[index * 2 + 0], st[index * 2 + 1]);
  st[index].first += storage[index];
  return;
}
class range {
 public:
  int64_t l, r, v;
};
range a[MAX];
pair<int64_t, int64_t> Ls[MAX];
pair<int64_t, int64_t> Vs[MAX];
int main() {
  cin >> n;
  for (int64_t i = 0; i < ((int64_t)(n)); ++i)
    cin >> a[i].l >> a[i].v >> a[i].r;
  for (int64_t i = 0; i < ((int64_t)(n)); ++i) Ls[i] = make_pair(a[i].l, i);
  for (int64_t i = 0; i < ((int64_t)(n)); ++i) Vs[i] = make_pair(a[i].v, i);
  sort(Ls, Ls + n);
  sort(Vs, Vs + n);
  for (N = 1; N < 300500; N *= 2)
    ;
  for (int64_t i = 0; i < ((int64_t)(SIZE)); ++i) st[i] = make_pair(0, i - N);
  memset(storage, 0, sizeof(storage));
  pair<int64_t, pair<int64_t, int64_t> > best =
      make_pair(-1, make_pair(-1, -1));
  int64_t l_index = 0;
  int64_t v_index = 0;
  while (l_index < n) {
    while (Vs[v_index].first < Ls[l_index].first) {
      int64_t index = Vs[v_index].second;
      update(1, 0, N, a[index].v, a[index].r + 1, -1);
      ++v_index;
    }
    int64_t index = Ls[l_index].second;
    update(1, 0, N, a[index].v, a[index].r + 1, 1);
    ++l_index;
    best =
        max(best, make_pair(st[1].first, make_pair(a[index].l, st[1].second)));
  }
  vector<int64_t> ans;
  for (int64_t i = 0; i < ((int64_t)(n)); ++i)
    if (a[i].l <= best.second.first && best.second.first <= a[i].v &&
        a[i].v <= best.second.second && best.second.second <= a[i].r)
      ans.push_back(i + 1);
  cout << ((int64_t)((ans).size())) << endl;
  for (int64_t i = 0; i < ((int64_t)(((int64_t)((ans).size())))); ++i)
    cout << ans[i] << " ";
  cout << endl;
}