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;
int n, p = (1 << 19);
pair<pair<int, int>, pair<int, int> > w[(1 << 20)];
int rmax[(1 << 20)];
priority_queue<pair<int, int> > pq;
int rpush[(1 << 20)];
int loc[(1 << 20)];
int best = 0, bestx = 0, besty = 0;
void push(int a) {
  rmax[a] += rpush[a];
  if (a < p) {
    rpush[2 * a] += rpush[a];
    rpush[2 * a + 1] += rpush[a];
  }
  rpush[a] = 0;
}
int get_max() {
  push(1);
  return rmax[1];
}
void range_add(int x, int lo, int hi, int qlo, int qhi, int val) {
  push(x);
  if (hi < qlo || lo > qhi) return;
  if (hi <= qhi && lo >= qlo) {
    rpush[x] += val;
    push(x);
    return;
  } else {
    range_add(2 * x, lo, (hi + lo) / 2, qlo, qhi, val);
    range_add(2 * x + 1, (hi + lo) / 2 + 1, hi, qlo, qhi, val);
    if (rmax[2 * x] < rmax[2 * x + 1]) {
      rmax[x] = rmax[2 * x + 1];
      loc[x] = loc[2 * x + 1];
    } else {
      rmax[x] = rmax[2 * x];
      loc[x] = loc[2 * x];
    }
  }
}
void do_loc(int x, int lo, int hi) {
  loc[x] = lo;
  if (x >= p) return;
  do_loc(2 * x, lo, (hi + lo) / 2);
  do_loc(2 * x + 1, (hi + lo) / 2 + 1, hi);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &w[i].first.first, &w[i].first.second,
          &w[i].second.first);
    w[i].second.second = i + 1;
  }
  sort(w, w + n);
  memset(rmax, 0, sizeof(rmax));
  memset(rpush, 0, sizeof(rpush));
  memset(loc, 0, sizeof(loc));
  do_loc(1, 1, p);
  int j = 0;
  while (j < n) {
    range_add(1, 1, p, w[j].first.second, w[j].second.first, 1);
    pq.push(pair<int, int>(-w[j].first.second, j));
    while (-pq.top().first < w[j].first.first) {
      range_add(1, 1, p, w[pq.top().second].first.second,
                w[pq.top().second].second.first, -1);
      pq.pop();
    }
    if (get_max() > best) {
      best = get_max();
      bestx = w[j].first.first;
      besty = loc[1];
    }
    j++;
  }
  vector<int> ans;
  for (int i = 0; i < n; i++) {
    if (w[i].first.first <= bestx && w[i].first.second >= bestx &&
        w[i].first.second <= besty && w[i].second.first >= besty) {
      ans.push_back(w[i].second.second);
    }
  }
  printf("%d\n", ans.size());
  for (int i = 0; i < (int)ans.size(); i++) {
    if (i != 0) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
}