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;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
namespace rm {
int incr[(524298 * 2)];
pair<int, int> minn[(524298 * 2)];
int n;
void init(int v, int a, int b) {
  minn[v] = make_pair(0, a);
  if (a < b) {
    int mid = (a + b) / 2;
    init(2 * v, a, mid);
    init(2 * v + 1, mid + 1, b);
  }
}
void init() { init(1, 0, n - 1); }
int aw, bw, x;
pair<int, int> operator+(pair<int, int> a, pair<int, int> b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
void zwieksz2(int v, int a, int b) {
  if (aw > b || bw < a) return;
  if (a >= aw && b <= bw) {
    incr[v] += x;
    minn[v].first += x;
  } else {
    int mid = (a + b) / 2;
    zwieksz2(2 * v, a, mid);
    zwieksz2(2 * v + 1, mid + 1, b);
    minn[v] = make_pair(incr[v], 0) + max(minn[2 * v], minn[2 * v + 1]);
  }
}
void zwieksz(int _aw, int _bw, int _x) {
  aw = _aw;
  bw = _bw;
  x = _x;
  zwieksz2(1, 0, n - 1);
}
pair<int, int> getmax(int v, int a, int b) {
  if (aw > b || bw < a) return make_pair(-1001001001, -1);
  if (a >= aw && b <= bw) {
    return minn[v];
  } else {
    int mid = (a + b) / 2;
    return make_pair(incr[v], 0) +
           max(getmax(2 * v, a, mid), getmax(2 * v + 1, mid + 1, b));
  }
}
pair<int, int> getmax(int _aw, int _bw) {
  aw = _aw;
  bw = _bw;
  return getmax(1, 0, n - 1);
}
};  // namespace rm
int l[300007], v[300007], r[300007];
vector<int> insertAt[300007], removeAt[300007];
void add(int i, int x) { rm::zwieksz(v[i], r[i], x); }
int main() {
  int(n);
  scanf("%d", &(n));
  for (int(i) = 1; (i) <= (n); ++(i)) scanf("%d %d %d", l + i, v + i, r + i);
  rm::n = 300007;
  rm::init();
  for (int(i) = 1; (i) <= (n); ++(i)) {
    insertAt[l[i]].push_back(i);
    removeAt[v[i] + 1].push_back(i);
  }
  int best = 0, bestX = -1, bestY = -1;
  for (int(x) = (1); (x) <= (300003); ++x) {
    for (typeof(insertAt[x].begin()) it = insertAt[x].begin();
         it != insertAt[x].end(); it++)
      add(*it, 1);
    for (typeof(removeAt[x].begin()) it = removeAt[x].begin();
         it != removeAt[x].end(); it++)
      add(*it, -1);
    pair<int, int> res = rm::getmax(1, 300000);
    if (res.first > best) {
      best = res.first;
      bestX = x;
      bestY = res.second;
    }
  }
  pisz(best);
  for (int(i) = 1; (i) <= (n); ++(i)) {
    if (l[i] <= bestX && bestX <= v[i] && v[i] <= bestY && bestY <= r[i])
      printf("%d ", i);
  }
}