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 = 4e5 + 10;
int ans, n, ma[maxn * 4], andis[maxn * 4], lazy[maxn * 4];
vector<int> v;
vector<pair<int, int> > sum[maxn];
vector<int> q[maxn];
pair<int, pair<int, int> > a[maxn];
pair<int, int> ans1;
vector<int> ans2;
void make_andis(int id = 1, int s = 0, int e = v.size()) {
  if (s + 1 == e) {
    andis[id] = s;
    return;
  }
  int mid = (s + e) / 2;
  make_andis(id << 1, s, mid);
  make_andis(id << 1 | 1, mid, e);
  andis[id] = s;
}
void put(int s, int e, int id, int x) {
  ma[id] += x;
  lazy[id] += x;
}
void shift(int s, int e, int id) {
  int mid = (s + e) / 2;
  put(s, mid, id << 1, lazy[id]);
  put(mid, e, id << 1 | 1, lazy[id]);
  lazy[id] = 0;
}
void update(int l, int r, int x, int id = 1, int s = 0, int e = v.size()) {
  if (e <= l || r <= s) return;
  if (l <= s && e <= r) {
    put(s, e, id, x);
    return;
  }
  shift(s, e, id);
  int mid = (s + e) / 2;
  update(l, r, x, id << 1, s, mid);
  update(l, r, x, id << 1 | 1, mid, e);
  ma[id] = max(ma[id << 1], ma[id << 1 | 1]);
  if (ma[id] == ma[id << 1])
    andis[id] = andis[id << 1];
  else
    andis[id] = andis[id << 1 | 1];
}
pair<int, int> get(int l, int r, int id = 1, int s = 0, int e = v.size()) {
  if (e <= l || r <= s) return make_pair(0, 0);
  if (l <= s && e <= r) return make_pair(ma[id], andis[id]);
  shift(s, e, id);
  int mid = (s + e) / 2;
  pair<int, int> p1;
  pair<int, int> p2;
  p1 = get(l, r, id << 1, s, mid);
  p2 = get(l, r, id << 1 | 1, mid, e);
  if (p1.first >= p2.first)
    return p1;
  else
    return p2;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int l, b, r, i = 0; i < n; i++) {
    cin >> l >> b >> r;
    a[i] = make_pair(l, make_pair(b, r));
    v.push_back(b);
    v.push_back(l);
    v.push_back(r);
  }
  sort(v.begin(), v.end());
  v.push_back(1e9);
  v.resize(unique(v.begin(), v.end()) - v.begin());
  pair<int, int> p;
  for (int i = 0; i < n; i++) {
    p = a[i].second;
    sum[lower_bound(v.begin(), v.end(), a[i].first) - v.begin()].push_back(
        make_pair(lower_bound(v.begin(), v.end(), p.first) - v.begin(),
                  lower_bound(v.begin(), v.end(), p.second) - v.begin()));
  }
  make_andis();
  for (int i = 0; i < v.size(); i++) {
    for (int j = 0; j < sum[i].size(); j++) {
      q[sum[i][j].first].push_back(sum[i][j].second + 1);
      update(sum[i][j].first, v.size(), 1);
      update(sum[i][j].second + 1, v.size(), -1);
    }
    p = get(i, v.size());
    if (p.first > ans) {
      ans = p.first;
      ans1.first = i;
      ans1.second = p.second;
    }
    for (int j = 0; j < q[i].size(); j++) {
      update(i, v.size(), -1);
      update(q[i][j], v.size(), 1);
    }
  }
  for (int i = 0; i < n; i++) {
    p = a[i].second;
    if (lower_bound(v.begin(), v.end(), a[i].first) - v.begin() <= ans1.first &&
        (lower_bound(v.begin(), v.end(), p.first) - v.begin() >= ans1.first &&
         lower_bound(v.begin(), v.end(), p.first) - v.begin() <= ans1.second) &&
        lower_bound(v.begin(), v.end(), p.second) - v.begin() >= ans1.second)
      ans2.push_back(i + 1);
  }
  cout << ans << endl;
  for (int i = 0; i < ans2.size(); i++) cout << ans2[i] << ' ';
  return 0;
}