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 int readint() {
  int a = 0;
  char c = getchar(), f = 1;
  for (; c < '0' || c > '9'; c = getchar())
    if (c == '-') f = -f;
  for (; '0' <= c && c <= '9'; c = getchar())
    a = (a << 3) + (a << 1) + (c ^ 48);
  return a * f;
}
inline void writeint(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x > 9) writeint(x / 10);
  putchar((x % 10) ^ 48);
}
const int MaxN = 300000;
int v[MaxN << 1 | 1], lazy[MaxN << 1 | 1];
void pushDown(int l, int r) {
  int &t = lazy[(l + r) | (l != r)];
  v[((l + (l + r) / 2) | (l != (l + r) / 2))] += t,
      lazy[((l + (l + r) / 2) | (l != (l + r) / 2))] += t;
  v[((l + r) / 2 + 1 + r) | ((l + r) / 2 + 1 != r)] += t,
      lazy[((l + r) / 2 + 1 + r) | ((l + r) / 2 + 1 != r)] += t;
  t = 0;
}
void pushUp(int l, int r) {
  v[(l + r) | (l != r)] =
      max(v[((l + (l + r) / 2) | (l != (l + r) / 2))],
          v[((l + r) / 2 + 1 + r) | ((l + r) / 2 + 1 != r)]);
}
void modify(int ql, int qr, int adv = 1, int l = 1, int r = MaxN) {
  int t = (l + r) | (l != r);
  if (ql <= l && r <= qr) {
    lazy[t] += adv, v[t] += adv;
    return;
  }
  pushDown(l, r);
  if (ql <= (l + r) / 2) modify(ql, qr, adv, l, (l + r) >> 1);
  if ((l + r) / 2 < qr) modify(ql, qr, adv, (l + r) / 2 + 1, r);
  pushUp(l, r);
}
int query(int l = 1, int r = MaxN) { return v[(l + r) | (l != r)]; }
struct People {
  int l, r, v, id;
  bool operator<(const People &q) const { return r < q.r; }
} p[MaxN];
vector<int> eraser[MaxN | 1];
int susu[MaxN | 1];
int main() {
  int n = readint();
  for (int i = 1; i <= n; ++i) {
    p[i].l = readint();
    p[i].v = readint();
    p[i].r = readint();
    p[i].id = i;
  }
  sort(p + 1, p + n + 1), p[0].r = -1;
  int ans = 0;
  int rid = -1;
  for (int r = MaxN, pid = n; r; --r) {
    for (; p[pid].r == r; --pid) {
      modify(p[pid].l, p[pid].v);
      eraser[p[pid].v].push_back(p[pid].l);
    }
    int llb = query();
    if (ans < llb) ans = llb, rid = r;
    llb = eraser[r].size();
    for (int i = 0; i < llb; ++i) modify(eraser[r][i], r, -1);
  }
  printf("%d\n", ans);
  for (int i = 1; i <= n; ++i)
    if (p[i].v <= rid && rid <= p[i].r) ++susu[p[i].l], --susu[p[i].v + 1];
  int lid = -1;
  for (int l = 1, now = 0; l <= MaxN; ++l)
    if ((now += susu[l]) == ans) {
      lid = l;
      break;
    }
  for (int i = 1; i <= n; ++i)
    if (p[i].v <= rid && rid <= p[i].r)
      if (p[i].l <= lid && lid <= p[i].v) printf("%d ", p[i].id);
  putchar('\n');
  return 0;
}