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;
struct ple {
  int l, v, r;
} p[100010];
int n, m, tot;
struct qes {
  int ty, l, r, x, id;
} q[200010];
struct seg_tre {
  struct node {
    int Max, flag;
  } tr[1200010];
  void pushdown(int p) {
    tr[(p << 1)].flag += tr[p].flag;
    tr[(p << 1)].Max += tr[p].flag;
    tr[((p << 1) + 1)].flag += tr[p].flag;
    tr[((p << 1) + 1)].Max += tr[p].flag;
    tr[p].flag = 0;
  }
  void updata(int p) {
    tr[p].Max = max(tr[(p << 1)].Max, tr[((p << 1) + 1)].Max);
  }
  void Cover(int p, int l, int r, int a, int b, int num) {
    if (l == a && r == b) {
      tr[p].flag += num;
      tr[p].Max += num;
      return;
    }
    if (tr[p].flag) pushdown(p);
    if (b <= ((l + r) >> 1))
      Cover((p << 1), l, ((l + r) >> 1), a, b, num);
    else if (a >= ((l + r) >> 1))
      Cover(((p << 1) + 1), ((l + r) >> 1), r, a, b, num);
    else {
      Cover((p << 1), l, ((l + r) >> 1), a, ((l + r) >> 1), num);
      Cover(((p << 1) + 1), ((l + r) >> 1), r, ((l + r) >> 1), b, num);
    }
    updata(p);
  }
  int GetMax(int Max) {
    int l = 1, r = m + 1, p = 1;
    for (;;) {
      if (l == r - 1) return l;
      if (tr[p].flag) pushdown(p);
      if (tr[(p << 1)].Max == Max)
        p = (p << 1), r = ((l + r) >> 1);
      else
        p = ((p << 1) + 1), l = ((l + r) >> 1);
    }
  }
} T;
bool b[100010];
void read(int &x) {
  char ch = getchar();
  int mark = 1;
  for (; ch != '-' && (ch < '0' || ch > '9'); ch = getchar())
    ;
  if (ch == '-') mark = -1, ch = getchar();
  for (x = 0; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - 48;
  x *= mark;
}
inline bool cmp(qes A, qes B) {
  if (A.x == B.x) return A.ty > B.ty;
  return A.x < B.x;
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    read(p[i].l);
    read(p[i].v);
    read(p[i].r);
    m = max(m, p[i].r);
    q[++tot].x = p[i].l;
    q[tot].ty = 1;
    q[tot].l = p[i].v;
    q[tot].r = p[i].r;
    q[tot].id = i;
    q[++tot].x = p[i].v;
    q[tot].ty = -1;
    q[tot].l = p[i].v;
    q[tot].r = p[i].r;
    q[tot].id = i;
  }
  sort(q + 1, q + tot + 1, cmp);
  int Max = 0;
  for (int i = 1; i <= tot; i++) {
    T.Cover(1, 1, m + 1, q[i].l, q[i].r + 1, q[i].ty);
    Max = max(Max, T.tr[1].Max);
  }
  printf("%d\n", Max);
  for (int i = 1; i <= tot; i++) {
    T.Cover(1, 1, m + 1, q[i].l, q[i].r + 1, q[i].ty);
    if (q[i].ty == 1)
      b[q[i].id] = 1;
    else
      b[q[i].id] = 0;
    if (Max == T.tr[1].Max) {
      int t = T.GetMax(Max);
      int c = 0;
      for (int j = 1; j <= n; j++)
        if (b[j] && p[j].v <= t && t <= p[j].r) {
          printf("%d", j);
          c++;
          if (c == Max)
            printf("\n");
          else
            printf(" ");
        }
      return 0;
    }
  }
  return 0;
}