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 R(int &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0'; ch = getchar())
    ;
  for (; ch >= '0'; ch = getchar()) x = x * 10 + ch - '0';
}
const int N = 100005;
int n, m = 0;
struct pt {
  int l, r, x;
  inline void read() {
    R(l);
    R(x);
    R(r);
  }
} a[N], *px[N], *pr[N];
inline bool cmpx(pt *x, pt *y) { return x->x < y->x; }
inline bool cmpr(pt *x, pt *y) { return x->r < y->r; }
namespace seg {
struct node {
  int mx, mf, sa;
  inline void SA(int x) { mx += x, sa += x; }
} a[1048577];
int tsz, tlv;
inline void D(int w) {
  if (a[w].sa != 0) {
    a[w << 1].SA(a[w].sa);
    a[(w << 1) | 1].SA(a[w].sa);
    a[w].sa = 0;
  }
}
void D(int l, int r) {
  for (int i = tlv; i; --i) {
    D(l >> i);
    if ((r >> i) != (l >> i)) D(r >> i);
  }
}
inline void nupd(int w) {
  if (a[w << 1].mx > a[(w << 1) | 1].mx) {
    a[w].mx = a[w << 1].mx, a[w].mf = a[w << 1].mf;
  } else {
    a[w].mx = a[(w << 1) | 1].mx, a[w].mf = a[(w << 1) | 1].mf;
  }
}
void B(int n) {
  for (++n, tlv = 0, tsz = 1; tsz <= n; tsz <<= 1, ++tlv)
    ;
  for (int i = 0; i < tsz; ++i) a[i | tsz].mf = i;
  for (int i = tsz - 1; i; --i) nupd(i);
}
void A(int l, int r, int x) {
  l |= tsz, r |= tsz, --l, ++r;
  D(l, r);
  for (; (l ^ r) > 1; l >>= 1, r >>= 1) {
    if (!(l & 1)) a[l ^ 1].SA(x);
    if (r & 1) a[r ^ 1].SA(x);
    nupd(l >> 1), nupd(r >> 1);
  }
  for (l >>= 1; l; l >>= 1) nupd(l);
}
}  // namespace seg
int main() {
  R(n);
  for (int i = 1; i <= n; ++i) {
    a[i].read(), px[i] = pr[i] = &a[i];
    m = max(m, a[i].r);
  }
  sort(px + 1, px + n + 1, cmpx);
  sort(pr + 1, pr + n + 1, cmpr);
  int cpx = 1, cpr = 1, ans = 0, al = 0, ar = 0;
  seg::B(m);
  for (int i = 1; i <= m; ++i) {
    for (; cpx <= n && px[cpx]->x <= i; ++cpx) seg::A(px[cpx]->l, i, 1);
    if (seg::a[1].mx > ans) {
      ans = seg::a[1].mx;
      al = seg::a[1].mf;
      ar = i;
    }
    for (; cpr <= n && pr[cpr]->r <= i; ++cpr)
      seg::A(pr[cpr]->l, pr[cpr]->x, -1);
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; ++i)
    if (a[i].x >= al && a[i].x <= ar && a[i].l <= al && a[i].r >= ar)
      printf("%d ", i);
  return 0;
}