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 readi(int &x);
const int maxn = 300005, N = 300000;
int n, m;
int l[maxn], r[maxn], v[maxn];
struct R {
  int pos, l, r, d;
  R() {}
  R(const int &p, const int &a, const int &b, const int &c) {
    pos = p, l = a, r = b, d = c;
  }
  bool operator<(const R &o) const { return pos < o.pos; }
} p[maxn];
struct node {
  int dta;
  int mx, mi;
  node *lc, *rc;
  void update() {
    if (lc->mx > rc->mx)
      mi = lc->mi, mx = lc->mx;
    else
      mi = rc->mi, mx = rc->mx;
  }
  void downdate() {
    if (dta) {
      lc->dta += dta, lc->mx += dta;
      rc->dta += dta, rc->mx += dta;
      dta = 0;
    }
  }
  void insert(int l, int r, const int &a, const int &b, const int &c) {
    if (l >= a && r <= b)
      dta += c, mx += c;
    else {
      int mid = l + r >> 1;
      downdate();
      if (a <= mid) lc->insert(l, mid, a, b, c);
      if (b > mid) rc->insert(mid + 1, r, a, b, c);
      update();
    }
  }
} ndl[maxn * 3], *root;
int ns = 1;
node *build(int l, int r) {
  node *c = ndl + ns++;
  if (l == r)
    return (c->mi = l, c);
  else {
    int mid = l + r >> 1;
    c->lc = build(l, mid);
    c->rc = build(mid + 1, r);
    c->update();
  }
  return c;
}
void init() {
  readi(n);
  for (int i = 1; i <= n; i++) {
    readi(l[i]), readi(v[i]), readi(r[i]);
    p[++m] = R(l[i], v[i], r[i], 1);
    p[++m] = R(v[i] + 1, v[i], r[i], -1);
  }
  root = build(1, N);
  sort(p + 1, p + m + 1);
}
void work() {
  int L = 0, R = 0, best = 0;
  for (int i = 1, j; i <= m; i = j) {
    for (j = i; j <= m && p[j].pos == p[i].pos; j++)
      root->insert(1, N, p[j].l, p[j].r, p[j].d);
    if (root->mx > best) {
      best = root->mx;
      L = p[i].pos;
      R = root->mi;
    }
  }
  printf("%d\n", best);
  for (int i = 1; i <= n; i++)
    if (l[i] <= L && v[i] >= L && v[i] <= R && r[i] >= R) printf("%d\n", i);
}
int main() {
  init();
  work();
  return 0;
}
inline void readi(int &x) {
  char c;
  for (c = getchar(); c > '9' || c < '0'; c = getchar())
    ;
  x = c ^ '0';
  for (c = getchar(); c >= '0' && c <= '9'; c = getchar())
    x = x * 10 + (c ^ '0');
}