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;
struct SegTree {
  struct segnode {
    long long int segans;
    long long int lazy;
    int sz;
  };
  const long long int NEUTRALQUERY = 0;
  const long long int NEUTRALLAZY = 0;
  vector<segnode> tree;
  int segsz;
  void init(int sz) {
    segsz = sz;
    tree.resize(4 * segsz);
  }
  segnode unite(segnode& a, segnode& b) {
    segnode ans;
    ans.sz = a.sz + b.sz;
    ans.segans = max(a.segans + a.lazy, b.segans + b.lazy);
    ans.lazy = NEUTRALLAZY;
    return ans;
  }
  void segpush(int v, int l, int r) {
    if (tree[v].lazy == NEUTRALLAZY) return;
    if (l == r) {
      tree[v].segans += tree[v].lazy;
      tree[v].lazy = NEUTRALLAZY;
      return;
    }
    int v1 = 2 * v + 1;
    int v2 = 2 * v + 2;
    int mid = (l + r) / 2;
    tree[v1].lazy += tree[v].lazy;
    tree[v2].lazy += tree[v].lazy;
    tree[v] = unite(tree[v1], tree[v2]);
  }
  void __build(int v, int l, int r, vector<long long int>& segTreeVect) {
    if (l > r) return;
    if (l == r) {
      tree[v].segans = segTreeVect[l];
      tree[v].sz = 1;
      return;
    }
    int v1 = 2 * v + 1;
    int v2 = 2 * v + 2;
    int mid = (l + r) / 2;
    __build(v1, l, mid, segTreeVect);
    __build(v2, mid + 1, r, segTreeVect);
    tree[v] = unite(tree[v1], tree[v2]);
  }
  segnode __query(int v, int l, int r, int L, int R) {
    segpush(v, l, r);
    if (l > r || l > R || r < L) return {NEUTRALQUERY, NEUTRALLAZY, 0};
    if (L <= l && r <= R) return tree[v];
    int v1 = 2 * v + 1;
    int v2 = 2 * v + 2;
    int mid = (l + r) / 2;
    segnode q1 = __query(v1, l, mid, L, R);
    segnode q2 = __query(v2, mid + 1, r, L, R);
    return unite(q1, q2);
  }
  void __update(int v, int l, int r, int L, int R, long long int uval) {
    segpush(v, l, r);
    if (l > r || l > R || r < L) return;
    if (L <= l && r <= R) {
      tree[v].lazy = uval;
      segpush(v, l, r);
      return;
    }
    int v1 = 2 * v + 1;
    int v2 = 2 * v + 2;
    int mid = (l + r) / 2;
    __update(v1, l, mid, L, R, uval);
    __update(v2, mid + 1, r, L, R, uval);
    tree[v] = unite(tree[v1], tree[v2]);
  }
  void build(vector<long long int>& segTreeVect) {
    __build(0, 1, segsz, segTreeVect);
  }
  segnode query(int L, int R) { return __query(0, 1, segsz, L, R); }
  void update(int L, int R, long long int uval) {
    __update(0, 1, segsz, L, R, uval);
  }
};
struct Employee {
  int l;
  int r;
  int v;
};
const int N = 3e5 + 10;
Employee emp[N];
set<int> vs[N];
set<int> rs[N];
vector<long long int> arr(N, 0);
SegTree tree;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> emp[i].l >> emp[i].v >> emp[i].r;
    rs[emp[i].r].insert(i);
    vs[emp[i].v].insert(i);
  }
  tree.init(N - 5);
  tree.build(arr);
  int ans = 0;
  int al, ar;
  for (int r = N - 5; r >= 0; r--) {
    for (int j : rs[r]) tree.update(emp[j].l, emp[j].v, 1);
    for (int j : vs[r + 1]) tree.update(emp[j].l, emp[j].v, -1);
    int curans = tree.query(1, r).segans;
    if (curans > ans) {
      ans = curans;
      ar = r;
    }
  }
  set<int> all;
  for (int r = N - 5; r >= 1; r--) {
    for (int j : rs[r]) tree.update(emp[j].l, emp[j].v, 1);
    for (int j : vs[r + 1]) tree.update(emp[j].l, emp[j].v, -1);
    if (ar == r) break;
  }
  {
    int l = 1, r = ar;
    while (r > l) {
      int mid = (l + r) / 2;
      if (tree.query(1, mid).segans == ans)
        r = mid;
      else
        l = mid + 1;
    }
    al = l;
  }
  cout << ans << "\n";
  for (int i = 1; i <= n; i++) {
    if (emp[i].l <= al && al <= emp[i].v && emp[i].v <= ar && ar <= emp[i].r) {
      cout << i << " ";
    }
  }
  cout << "\n";
  return 0;
}