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 = 100020;
const int maxx = 10000;
const int MOd = 1e9 + 7;
const int K = 750;
struct data {
  int l, r, id, val;
  friend bool operator<(const data &a, const data &b) { return a.val < b.val; }
  data(int a = 0) { val = a; }
} ar[maxn];
int n;
class segment_tree {
 public:
  pair<int, int> segment[1 << 19];
  int lazy[1 << 19];
  void push(int k) {
    if (lazy[k]) {
      if (k < n) {
        lazy[k + k] += lazy[k];
        lazy[k + k + 1] += lazy[k];
      }
      segment[k].first += lazy[k];
      lazy[k] = 0;
    }
  }
  void init() {
    for (int i = n; i < n + n; i++) segment[i].second = i - n + 1;
    for (int k = n - 1; k > 0; k--)
      segment[k] = max(segment[k + k], segment[k + k + 1]);
  }
  void update(int k, int b, int s, int x, int y, int m) {
    push(k);
    if (b > y || x > s) return;
    if (x <= b && s <= y) {
      lazy[k] += m;
      push(k);
      return;
    }
    update(k + k, b, (b + s) / 2, x, y, m);
    update(k + k + 1, (b + s) / 2 + 1, s, x, y, m);
    segment[k] = max(segment[k + k], segment[k + k + 1]);
  }
  pair<int, int> find(int k, int b, int s, int x, int y) {
    if (b > y || x > s) return pair<int, int>(-1, 0);
    if (x <= b && s <= y) return segment[1];
    return max(find(k + k, b, (b + s) / 2, x, y),
               find(k + k + 1, (b + s) / 2 + 1, s, x, y));
  }
} s;
int a;
int main() {
  scanf("%d", &a);
  n = 1;
  while (n < a) n <<= 1;
  for (int i = 1; i <= a; i++)
    scanf("%d %d %d", &ar[i].l, &ar[i].val, &ar[i].r), ar[i].id = i;
  sort(ar + 1, ar + 1 + a);
  for (int i = 1; i <= a; i++) {
    ar[i].l = lower_bound(ar + 1, ar + 1 + a, data(ar[i].l)) - ar;
    ar[i].r = upper_bound(ar + 1, ar + a + 1, data(ar[i].r)) - ar - 1;
  }
  priority_queue<pair<int, int> > q;
  int maxi = 0;
  int L = 0, R = 0;
  s.init();
  for (int i = a; i >= 1; i--) {
    q.push(pair<int, int>(ar[i].l, i));
    s.update(1, 1, n, i, ar[i].r, 1);
    while (!q.empty() && q.top().first > i) {
      s.update(1, 1, n, q.top().second, ar[q.top().second].r, -1);
      q.pop();
    }
    pair<int, int> t = s.find(1, 1, n, i, n);
    if (t.first > maxi) {
      maxi = t.first;
      L = i;
      R = t.second;
    }
  }
  vector<int> ans;
  for (int i = L; i <= R; i++)
    if (ar[i].l <= L && R <= ar[i].r) ans.push_back(ar[i].id);
  cout << ans.size() << endl;
  sort(ans.begin(), ans.end());
  for (int i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}