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;
template <class T>
inline void RST(T &A, char x = 0) {
  memset(A, x, sizeof(A));
}
template <class T>
inline void SRT(T &A) {
  sort(A.begin(), A.end());
}
template <class T, class C>
inline void SRT(T &A, C B) {
  sort(A.begin(), A.end(), B);
}
const int DX[4] = {1, -1, 0, 0};
const int DY[4] = {0, 0, -1, 1};
const int inf = 0x3f3f3f3f;
const long long linf = 1LL << 60;
const double eps = 1e-9;
const double oo = 1e70;
const double pi = acos(-1.0);
inline double dcmp(const double &x) { return (x > eps) - (x < -eps); }
inline double dcmp(const double &x, const double &y) { return dcmp(x - y); }
template <class T>
inline void RD(T &x) {
  char c = getchar();
  x = 0;
  int flg = 0;
  while (c < '0' || c > '9') flg |= c == '-', c = getchar();
  while (c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0', c = getchar();
  if (flg) x = -x;
}
template <class T1, class T2>
inline void RD(T1 &x, T2 &y) {
  RD(x);
  RD(y);
}
template <class T1, class T2, class T3>
inline void RD(T1 &x, T2 &y, T3 &z) {
  RD(x);
  RD(y);
  RD(z);
}
template <class T1, class T2, class T3, class T4>
inline void RD(T1 &x, T2 &y, T3 &z, T4 &w) {
  RD(x);
  RD(y);
  RD(z);
  RD(w);
}
inline long long RD() {
  long long x;
  RD(x);
  return x;
}
inline void OT(int x) { printf("%d\n", x); }
inline void OT(long long x) { printf("%I64d\n", x); }
inline void OT(int x, int y) { printf("%d %d\n", x, y); }
inline void OT(long long x, long long y) { printf("%I64d %I64d\n", x, y); }
inline void setIO(char *in, char *out) {
  if (in) freopen(in, "r", stdin);
  if (out) freopen(out, "w", stdout);
}
template <class T>
inline void upmax(T &ans, const T &x) {
  ans = max(ans, x);
}
template <class T>
inline void upmin(T &ans, const T &x) {
  ans = min(ans, x);
}
inline char getAlpha() {
  char c = getchar();
  while (c < 'A' || c > 'Z') c = getchar();
  return c;
}
inline char getalpha() {
  char c = getchar();
  while (c < 'a' || c > 'z') c = getchar();
  return c;
}
const int maxn = 300000 + 5;
struct Interval {
  int l, r, v;
  inline void RD() { ::RD(l, v, r); }
} itl[maxn];
vector<int> iL[maxn], iV[maxn];
int N, mxR;
namespace SegTree {
struct TNode {
  int dlt;
  pair<int, int> msg;
} T[maxn << 2];
inline void do_add(int rt, int v) {
  T[rt].msg.first += v;
  T[rt].dlt += v;
}
inline void pd(int rt) {
  if (T[rt].dlt)
    do_add((rt << 1), T[rt].dlt), do_add((rt << 1 | 1), T[rt].dlt),
        T[rt].dlt = 0;
}
void build(int rt, int l, int r) {
  T[rt].msg = make_pair(0, r);
  if (l == r) return;
  int mid = l + r >> 1;
  build((rt << 1), l, mid), build((rt << 1 | 1), mid + 1, r);
  T[rt].msg = max((T[(rt << 1)]).msg, (T[(rt << 1 | 1)]).msg);
}
void upd(int rt, int L, int R, int l, int r, int v) {
  if (l > R || r < L) return;
  if (L != R) pd(rt);
  if (l <= L && R <= r) {
    do_add(rt, v);
    return;
  }
  int mid = L + R >> 1;
  upd((rt << 1), L, mid, l, r, v), upd((rt << 1 | 1), mid + 1, R, l, r, v);
  T[rt].msg = max((T[(rt << 1)]).msg, (T[(rt << 1 | 1)]).msg);
}
}  // namespace SegTree
int main() {
  RD(N);
  for (int i = 1; i <= int(N); i++) {
    itl[i].RD();
    iL[itl[i].l].push_back(i), iV[itl[i].v].push_back(i);
    upmax(mxR, itl[i].r);
  }
  int ans = 0, L, R;
  SegTree::build(1, 1, mxR);
  for (int i = 1; i <= int(mxR); i++) {
    for (__typeof(iL[i].begin()) it = iL[i].begin(); it != iL[i].end(); ++it)
      SegTree::upd(1, 1, mxR, itl[*it].v, itl[*it].r, 1);
    pair<int, int> &msg = SegTree::T[1].msg;
    if (ans < msg.first) ans = msg.first, L = i, R = msg.second;
    for (__typeof(iV[i].begin()) it = iV[i].begin(); it != iV[i].end(); ++it)
      SegTree::upd(1, 1, mxR, itl[*it].v, itl[*it].r, -1);
  }
  OT(ans);
  for (int i = 1; i <= int(N); i++)
    if (itl[i].l <= L && L <= itl[i].v && itl[i].v <= R && R <= itl[i].r)
      printf("%d ", i);
  return 0;
}