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 <typename T, typename U>
struct seg_tree_lazy {
  int S, H;
  T zero;
  vector<T> value;
  U noop;
  vector<bool> dirty;
  vector<U> prop;
  seg_tree_lazy<T, U>(int _S, T _zero = T(), U _noop = U()) {
    zero = _zero, noop = _noop;
    for (S = 1, H = 1; S < _S;) S *= 2, H++;
    value.resize(2 * S, zero);
    dirty.resize(2 * S, false);
    prop.resize(2 * S, noop);
  }
  void set_leaves(vector<T> &leaves) {
    copy(leaves.begin(), leaves.end(), value.begin() + S);
    for (int i = S - 1; i > 0; i--) value[i] = value[2 * i] + value[2 * i + 1];
  }
  void apply(int i, U &update) {
    value[i] = update(value[i]);
    if (i < S) {
      prop[i] = prop[i] + update;
      dirty[i] = true;
    }
  }
  void rebuild(int i) {
    for (int l = i / 2; l; l /= 2) {
      T combined = value[2 * l] + value[2 * l + 1];
      value[l] = prop[l](combined);
    }
  }
  void propagate(int i) {
    for (int h = H; h > 0; h--) {
      int l = i >> h;
      if (dirty[l]) {
        apply(2 * l, prop[l]);
        apply(2 * l + 1, prop[l]);
        prop[l] = noop;
        dirty[l] = false;
      }
    }
  }
  void upd(int i, int j, U update) {
    i += S, j += S;
    propagate(i), propagate(j);
    for (int l = i, r = j; l <= r; l /= 2, r /= 2) {
      if ((l & 1) == 1) apply(l++, update);
      if ((r & 1) == 0) apply(r--, update);
    }
    rebuild(i), rebuild(j);
  }
  T query(int i, int j) {
    i += S, j += S;
    propagate(i), propagate(j);
    T res_left = zero, res_right = zero;
    for (; i <= j; i /= 2, j /= 2) {
      if ((i & 1) == 1) res_left = res_left + value[i++];
      if ((j & 1) == 0) res_right = value[j--] + res_right;
    }
    return res_left + res_right;
  }
};
struct node {
  int value;
  int where;
  node operator+(const node &n) {
    if (value > n.value)
      return *this;
    else
      return n;
  }
};
struct update {
  int value;
  node operator()(const node &n) { return {n.value + value, n.where}; }
  update operator+(const update &u) { return {value + u.value}; }
};
struct worker {
  int l, v, r, id;
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int N;
  cin >> N;
  vector<worker> workers(N);
  for (int(i) = 0; (i) < (int)(N); (i)++) {
    cin >> workers[i].l >> workers[i].v >> workers[i].r;
    workers[i].id = i;
  }
  vector<worker> l_workers = workers;
  sort(workers.begin(), workers.end(),
       [](const worker &a, const worker &b) { return a.v < b.v; });
  sort(l_workers.begin(), l_workers.end(),
       [](const worker &a, const worker &b) { return a.l < b.l; });
  seg_tree_lazy<node, update> st(310000, {-1, -1}, {0});
  vector<node> leaves(310000, {0, 0});
  for (int(i) = 0; (i) < (int)(310000); (i)++) leaves[i].where = i;
  st.set_leaves(leaves);
  int ans = 0;
  int ansL = 0;
  int ansR = 0;
  for (int i = 300000; i >= 1; i--) {
    while (!workers.empty() && workers.back().v == i) {
      st.upd(workers.back().v, workers.back().r, {1});
      workers.pop_back();
    }
    while (!l_workers.empty() && l_workers.back().l == i + 1) {
      st.upd(l_workers.back().v, l_workers.back().r, {-1});
      l_workers.pop_back();
    }
    node qry = st.query(1, 305000);
    if (qry.value > ans) {
      ans = qry.value;
      ansL = i;
      ansR = qry.where;
    }
  }
  cout << ans << endl;
  for (int(i) = 0; (i) < (int)(N); (i)++) {
    if (workers[i].l <= ansL && ansL <= workers[i].v && workers[i].v <= ansR &&
        ansR <= workers[i].r) {
      cout << workers[i].id + 1 << " ";
    }
  }
  cout << endl;
}