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;
const int MAXN = 1e5 + 10, inf = 1e9, N = 3e5 + 1;
int seg[4 * MAXN], lazy[4 * MAXN], id[4 * MAXN], r_ind[MAXN];
vector<pair<pair<int, int>, int> > l[N], r[N], v[N];
vector<int> r_sorted;
void build(int v, int s, int e) {
  if (e - s < 2) {
    seg[v] = -inf;
    id[v] = s;
    return;
  }
  int mid = (s + e) / 2;
  build(2 * v, s, mid);
  build(2 * v + 1, mid, e);
  seg[v] = seg[2 * v];
  id[v] = id[2 * v];
  return;
}
void shift(int v) {
  lazy[2 * v] += lazy[v];
  seg[2 * v] += lazy[v];
  lazy[2 * v + 1] += lazy[v];
  seg[2 * v + 1] += lazy[v];
  lazy[v] = 0;
}
void upd(int v, int l, int r, int val, int s, int e) {
  if (l <= s and e <= r) {
    seg[v] += val;
    lazy[v] += val;
    return;
  }
  if (e <= l or r <= s) return;
  shift(v);
  int mid = (s + e) / 2;
  upd(2 * v, l, r, val, s, mid);
  upd(2 * v + 1, l, r, val, mid, e);
  seg[v] = max(seg[2 * v], seg[2 * v + 1]);
  id[v] = (seg[2 * v] > seg[2 * v + 1] ? id[2 * v] : id[2 * v + 1]);
  return;
}
int main() {
  int n;
  cin >> n;
  build(1, 0, n);
  for (int i = 0; i < n; i++) {
    int l2, v2, r2;
    cin >> l2 >> v2 >> r2;
    l[l2].push_back({{v2, r2}, i});
    v[v2].push_back({{l2, r2}, i});
    r[r2].push_back({{l2, v2}, i});
    r_sorted.push_back(r2);
  }
  int index = 0, mx = -1, id_l, id_r;
  for (int i = 0; i < 3e5 + 1; i++)
    for (auto u : r[i]) r_ind[u.second] = index++;
  sort(r_sorted.begin(), r_sorted.end());
  for (int i = 0; i < 3e5 + 1; i++) {
    for (auto u : l[i]) {
      upd(1, r_ind[u.second], r_ind[u.second] + 1, inf, 0, n);
      int ind = lower_bound(r_sorted.begin(), r_sorted.end(), u.first.first) -
                r_sorted.begin();
      upd(1, ind, r_ind[u.second] + 1, +1, 0, n);
    }
    if (i > 0) {
      for (auto u : v[i - 1]) {
        int ind = lower_bound(r_sorted.begin(), r_sorted.end(), i - 1) -
                  r_sorted.begin();
        upd(1, ind, r_ind[u.second] + 1, -1, 0, n);
      }
      for (auto u : r[i - 1])
        upd(1, r_ind[u.second], r_ind[u.second] + 1, -inf, 0, n);
    }
    if (seg[1] > mx) {
      mx = seg[1];
      id_l = i;
      id_r = r_sorted[id[1]];
    }
  }
  cout << mx << endl;
  for (int i = id_l; i <= id_r; i++)
    for (auto u : v[i])
      if (u.first.first <= id_l and u.first.second >= id_r)
        cout << u.second + 1 << ' ';
  return 0;
}