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;
int n, nut[4 * MAXN], p[MAXN], cl[MAXN];
pair<int, int> weed[4 * MAXN];
pair<pair<int, int>, pair<int, int>> vec[MAXN];
set<pair<int, int>> st;
bool cmp(pair<pair<int, int>, pair<int, int>> a,
         pair<pair<int, int>, pair<int, int>> b) {
  if (a.second.first != b.second.first) return a.second.first < b.second.first;
  return a.first.first < b.first.first;
}
void plant(int v, int b, int e) {
  if (e - b == 1) {
    weed[v] = {0, b};
    return;
  }
  int mid = (b + e) / 2;
  plant(v << 1, b, mid);
  plant(v << 1 ^ 1, mid, e);
  weed[v] = max(weed[v << 1], weed[v << 1 ^ 1]);
}
void absorb(int v) {
  nut[v << 1] += nut[v];
  nut[v << 1 ^ 1] += nut[v];
  weed[v << 1].first += nut[v];
  weed[v << 1 ^ 1].first += nut[v];
  nut[v] = 0;
}
void burn(int v, int b, int e, int pos) {
  if (e - b == 1) {
    weed[v].first = -1e7;
    return;
  }
  int mid = (b + e) / 2;
  absorb(v);
  if (pos < mid)
    burn(v << 1, b, mid, pos);
  else
    burn(v << 1 ^ 1, mid, e, pos);
  weed[v] = max(weed[v << 1], weed[v << 1 ^ 1]);
}
void water(int v, int b, int e, int l, int r, int val) {
  if (l <= b && e <= r) {
    weed[v].first += val;
    nut[v] += val;
    return;
  }
  if (r <= b || e <= l) return;
  int mid = (b + e) / 2;
  absorb(v);
  water(v << 1, b, mid, l, r, val);
  water(v << 1 ^ 1, mid, e, l, r, val);
  weed[v] = max(weed[v << 1], weed[v << 1 ^ 1]);
}
pair<int, int> smoke(int v, int b, int e, int l, int r) {
  if (l <= b && e <= r) return weed[v];
  if (r <= b || e <= l) return {-1e7, -1};
  int mid = (b + e) / 2;
  absorb(v);
  return max(smoke(v << 1, b, mid, l, r), smoke(v << 1 ^ 1, mid, e, l, r));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++)
    cin >> vec[i].first.first >> vec[i].second.first >> vec[i].first.second,
        vec[i].second.second = i, vec[i].first.first--, vec[i].second.first--;
  sort(vec, vec + n, cmp);
  for (int i = 0; i < n; i++) p[i] = vec[i].second.first;
  pair<pair<int, int>, int> mx = {{-49, -233}, -228};
  plant(1, 0, n);
  for (int i = 0; i < n; i++) {
    while (st.size() && st.begin()->first <= vec[i].second.first) {
      int id = st.begin()->second;
      burn(1, 0, n, id);
      water(1, 0, n, cl[id], id, -1);
      st.erase(st.begin());
    }
    int pl = lower_bound(p, p + n, vec[i].first.first) - p;
    cl[i] = pl;
    st.insert({vec[i].first.second, i});
    water(1, 0, n, pl, i + 1, 1);
    mx = max(mx, {smoke(1, 0, n, pl, i + 1), i});
  }
  cout << mx.first.first << "\n";
  int tl = mx.first.second, tr = mx.second;
  for (int i = tl; i <= tr; i++)
    if (vec[i].first.second > vec[tr].second.first &&
        vec[i].first.first <= vec[tl].second.first)
      cout << vec[i].second.second + 1 << " ";
  cout << "\n";
  return 0;
}