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 = 100000 + 10;
const int maxx = 300000 + 10;
struct Line {
  int pos;
  vector<pair<pair<int, int>, int> > v;
} line[maxx];
pair<pair<int, int>, pair<int, int> > a[maxn];
int seg[4 * maxx], mx[4 * maxx], l[maxn], r[maxn], vv[maxn], mark[maxx], n, num,
    ans, parx, pary, par[4 * maxx];
bool Cmp(Line x, Line y) { return x.pos < y.pos; }
void Built_Tree(int s, int e, int tag) {
  par[tag] = s;
  if (s == e) return;
  int mid = (s + e) / 2;
  Built_Tree(s, mid, tag * 2);
  Built_Tree(mid + 1, e, tag * 2 + 1);
  return;
}
void Add(int s, int e, int tag, int l, int r, int val) {
  if (e < l || s > r) return;
  if (s >= l && e <= r) {
    seg[tag] += val;
    mx[tag] += val;
    return;
  }
  int mid = (s + e) / 2;
  Add(s, mid, tag * 2, l, r, val);
  Add(mid + 1, e, tag * 2 + 1, l, r, val);
  if (mx[tag * 2] > mx[tag * 2 + 1]) {
    mx[tag] = seg[tag] + mx[tag * 2];
    par[tag] = par[tag * 2];
  } else {
    mx[tag] = seg[tag] + mx[tag * 2 + 1];
    par[tag] = par[tag * 2 + 1];
  }
  return;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> l[i] >> vv[i] >> r[i];
    a[i].first.first = vv[i];
    a[i].first.second = l[i];
    a[i].second.first = r[i];
    a[i].second.second = vv[i];
  }
  for (int i = 1; i <= n; i++) {
    if (!mark[a[i].first.first]) {
      num++;
      line[num].pos = a[i].first.first;
      line[num].v.push_back(
          make_pair(make_pair(a[i].first.second, a[i].second.second), 1));
      mark[a[i].first.first] = num;
    } else {
      int now = mark[a[i].first.first];
      line[now].v.push_back(
          make_pair(make_pair(a[i].first.second, a[i].second.second), 1));
    }
    if (!mark[a[i].second.first]) {
      num++;
      line[num].pos = a[i].second.first;
      line[num].v.push_back(
          make_pair(make_pair(a[i].first.second, a[i].second.second), -1));
      mark[a[i].second.first] = num;
    } else {
      int now = mark[a[i].second.first];
      line[now].v.push_back(
          make_pair(make_pair(a[i].first.second, a[i].second.second), -1));
    }
  }
  sort(line + 1, line + num + 1, Cmp);
  Built_Tree(1, maxx, 1);
  for (int i = 1; i < num; i++) {
    for (int j = 0; j < line[i].v.size(); j++) {
      pair<pair<int, int>, int> now = line[i].v[j];
      if (now.second == 1)
        Add(1, maxx, 1, now.first.first, now.first.second, now.second);
    }
    if (ans < mx[1]) {
      ans = mx[1];
      parx = line[i].pos;
      pary = par[1];
    }
    for (int j = 0; j < line[i].v.size(); j++) {
      pair<pair<int, int>, int> now = line[i].v[j];
      if (now.second == -1)
        Add(1, maxx, 1, now.first.first, now.first.second, now.second);
    }
  }
  cout << ans << endl;
  for (int i = 1; i <= n; i++) {
    if (vv[i] <= parx && r[i] >= parx && vv[i] >= pary && l[i] <= pary)
      cout << i << " ";
  }
}