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 N = 3e5 + 5;
struct worker {
  int l, r, v;
  bool operator<(const worker x) const {
    if (l == x.l) return r < x.r;
    return l < x.l;
  }
} a[N];
int n;
istream &operator>>(istream &is, worker &x) { return is >> x.l >> x.v >> x.r; }
pair<int, int> tree[4 * N];
int laz[4 * N];
void build(int node, int s, int e) {
  if (s == e) {
    tree[node].second = s;
    return;
  }
  int md = (s + e) >> 1;
  build(node << 1, s, md);
  build(node << 1 | 1, md + 1, e);
  tree[node] = max(tree[node << 1], tree[node << 1 | 1]);
}
void laz_out(int node, int s, int e) {
  tree[node].first += laz[node];
  if (s != e) {
    laz[node << 1] += laz[node];
    laz[node << 1 | 1] += laz[node];
  }
  laz[node] = 0;
}
void update(int node, int s, int e, int l, int r, int val) {
  laz_out(node, s, e);
  if (r < s || e < l || l > r) return;
  if (l <= s && e <= r) {
    laz[node] += val;
    laz_out(node, s, e);
    return;
  }
  int md = (s + e) >> 1;
  update(node << 1, s, md, l, r, val);
  update(node << 1 | 1, md + 1, e, l, r, val);
  tree[node] = max(tree[node << 1], tree[node << 1 | 1]);
}
pair<int, int> qry(int node, int s, int e, int l, int r) {
  if (r < s || e < l || l > r) return {-1e9, -1e9};
  if (l <= s && e <= r) return tree[node];
  int md = (s + e) >> 1;
  return max(qry(node << 1, s, md, l, r), qry(node << 1 | 1, md + 1, e, l, r));
}
vector<int> upd[N];
vector<int> go_to[N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  worker b[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    upd[a[i].v].push_back(i);
    go_to[a[i].l].push_back(i);
  }
  build(1, 1, N - 1);
  int ans = 0;
  int idx = -1;
  int idx2 = -1;
  for (int i = N - 1; i > 0; i--) {
    for (auto v : upd[i]) {
      update(1, 1, N - 1, a[v].v, a[v].r, 1);
    }
    int cur = qry(1, 1, N - 1, i, N - 1).first;
    if (cur > ans) {
      ans = cur;
      idx = i;
      idx2 = qry(1, 1, N - 1, i, N - 1).second;
    }
    for (auto v : go_to[i]) {
      update(1, 1, N - 1, a[v].v, a[v].r, -1);
    }
  }
  cout << ans << '\n';
  for (int i = 0; i < n; i++) {
    if (a[i].l <= idx && a[i].r >= idx2 && a[i].v <= idx2 && a[i].v >= idx)
      cout << i + 1 << " \n"[i + 1 == n];
  }
}