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 oo = 1e9 + 7;
int n, rL, rR, ans = 0;
vector<pair<pair<int, pair<int, int> >, int> > E;
vector<int> F, Lazy;
vector<pair<int, pair<int, int> > > P;
int left(int k) { return (k << 1); }
int right(int k) { return (k << 1) + 1; }
bool cmp(const pair<pair<int, pair<int, int> >, int> &a,
         const pair<pair<int, pair<int, int> >, int> &b) {
  return (a.first.first == b.first.first ? a.second > b.second
                                         : a.first.first <= b.first.first);
}
void DoLazy(int k, int l, int r) {
  if (!Lazy[k]) return;
  F[k] += Lazy[k];
  if (l == r) {
    Lazy[k] = 0;
    return;
  }
  Lazy[left(k)] += Lazy[k];
  Lazy[right(k)] += Lazy[k];
  Lazy[k] = 0;
}
void Add(int k, int l, int r, const int &L, const int &R) {
  DoLazy(k, l, r);
  if (r < L || R < l || l > r) return;
  if (L <= l && r <= R) {
    ++Lazy[k];
    DoLazy(k, l, r);
    return;
  }
  int m = (l + r) / 2;
  Add(left(k), l, m, L, R);
  Add(right(k), m + 1, r, L, R);
  F[k] = max(F[left(k)], F[right(k)]);
}
void Remove(int k, int l, int r, const int &L, const int &R) {
  DoLazy(k, l, r);
  if (r < L || R < l || l > r) return;
  if (L <= l && r <= R) {
    --Lazy[k];
    DoLazy(k, l, r);
    return;
  }
  int m = (l + r) / 2;
  Remove(left(k), l, m, L, R);
  Remove(right(k), m + 1, r, L, R);
  F[k] = max(F[left(k)], F[right(k)]);
}
pair<int, int> Get(int k, int l, int r) {
  DoLazy(k, l, r);
  if (l == r) return pair<int, int>(F[k], l);
  int m = (l + r) / 2;
  return ((F[left(k)] + Lazy[left(k)]) >= (F[right(k)] + Lazy[right(k)])
              ? Get(left(k), l, m)
              : Get(right(k), m + 1, r));
}
void print(int k, int l, int r) {
  DoLazy(k, l, r);
  cout << k << " " << l << " " << r << " " << F[k] << endl;
  if (l == r) return;
  int m = l + r >> 1;
  print(left(k), l, m);
  print(right(k), m + 1, r);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  int tmp = 0;
  for (int i = 0; i < n; ++i) {
    int l, v, r;
    cin >> l >> v >> r;
    tmp = max(tmp, r);
    P.push_back(pair<int, pair<int, int> >(l, pair<int, int>(v, r)));
    E.push_back(pair<pair<int, pair<int, int> >, int>(
        pair<pair<int, pair<int, int> >, int>(
            pair<int, pair<int, int> >(v, pair<int, int>(l, v)), 1)));
    E.push_back(pair<pair<int, pair<int, int> >, int>(
        pair<pair<int, pair<int, int> >, int>(
            pair<int, pair<int, int> >(r, pair<int, int>(l, v)), -1)));
  }
  sort(E.begin(), E.end(), cmp);
  n = tmp;
  F.assign(5 * n + 1, 0);
  ;
  Lazy.assign(5 * n + 1, 0);
  ;
  for (int i = 0; i < E.size(); ++i) {
    int cR = E[i].first.first, L = E[i].first.second.first,
        R = E[i].first.second.second, type = E[i].second;
    if (type > 0) Add(1, 1, n, L, R);
    if (type < 0) Remove(1, 1, n, L, R);
    pair<int, int> cur = Get(1, 1, n);
    int cL = cur.second;
    if (ans < cur.first) {
      ans = cur.first;
      rL = cL;
      rR = cR;
    }
  }
  vector<int> res;
  for (int i = 0; i < P.size(); ++i) {
    int l = P[i].first, v = P[i].second.first, r = P[i].second.second;
    if (l <= rL && rL <= v && v <= rR && rR <= r) res.push_back(i + 1);
  }
  printf("%d\n", (int)res.size());
  for (int i = 0; i < res.size(); ++i) printf("%d ", res[i]);
  printf("\n");
}