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>
inline void smin(T &a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void smax(T &a, T b) {
  if (a < b) a = b;
}
const int maxn = 100 * 1000 + 100;
const int RANGE = 3 * 100 * 1000 + 100;
int n;
pair<pair<int, int>, pair<int, int> > LVR[maxn], VLR[maxn];
int add_val[4 * RANGE], max_val[4 * RANGE];
void add_range(int x, int nl, int nr, int ql, int qr, int val) {
  if (nr <= ql || qr <= nl) return;
  if (ql <= nl && nr <= qr) {
    add_val[x] += val;
    max_val[x] += val;
    return;
  }
  add_val[2 * x + 1] += add_val[x], max_val[2 * x + 1] += add_val[x];
  add_val[2 * x + 2] += add_val[x], max_val[2 * x + 2] += add_val[x];
  add_val[x] = 0;
  int nm = (nl + nr) / 2;
  add_range(2 * x + 1, nl, nm, ql, qr, val);
  add_range(2 * x + 2, nm, nr, ql, qr, val);
  max_val[x] = max(max_val[2 * x + 1], max_val[2 * x + 2]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 0, _n = (int)(n); i < _n; i++) {
    cin >> LVR[i].first.first >> LVR[i].first.second >> LVR[i].second.first;
    LVR[i].second.first++;
    LVR[i].second.second = i;
    VLR[i] = LVR[i];
    swap(VLR[i].first.first, VLR[i].first.second);
  }
  sort(LVR, LVR + n);
  sort(VLR, VLR + n);
  int pos = 0;
  int ans = 0, ind = 0;
  for (int i = 0, _n = (int)(n); i < _n; i++) {
    while (pos < n && LVR[pos].first.first <= VLR[i].first.first)
      add_range(0, 0, RANGE, LVR[pos].first.second, LVR[pos].second.first, 1),
          pos++;
    if (max_val[0] >= ans) ans = max_val[0], ind = i;
    add_range(0, 0, RANGE, VLR[i].first.first, VLR[i].second.first, -1);
  }
  cout << ans << endl;
  vector<int> LS, RS;
  for (int i = (int)(ind), _n = (int)(n); i < _n; i++)
    if (VLR[i].first.second <= VLR[ind].first.first &&
        VLR[i].first.first < VLR[ind].second.first)
      LS.push_back(VLR[i].first.first), RS.push_back(VLR[i].second.first);
  sort((LS).begin(), (LS).end()), sort((RS).begin(), (RS).end());
  int max_cur = -1, max_i = -1, cur = 0;
  pos = 0;
  for (int i = 0, _n = (int)((int((LS).size()))); i < _n; i++) {
    while (pos < (int((RS).size())) && RS[pos] <= LS[i]) cur--, pos++;
    cur++;
    if (max_cur < cur) max_cur = cur, max_i = i;
  }
  cerr << " @@ " << max_cur << ' ' << LS[max_i] << endl;
  for (int i = (int)(ind), _n = (int)(n); i < _n; i++)
    if (VLR[i].first.second <= VLR[ind].first.first &&
        VLR[i].first.first < VLR[ind].second.first &&
        VLR[i].first.first <= LS[max_i] && LS[max_i] < VLR[i].second.first)
      cout << VLR[i].second.second + 1 << ' ';
  cout << endl;
  {
    int _;
    cin >> _;
    return 0;
  }
}