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>
#pragma warning(disable : 4996)
using namespace std;
int n;
struct LIST {
  int l, v, r;
} a[200000];
struct OP {
  int t, op, idx;
  bool operator()(OP p, OP q) {
    if (p.t != q.t)
      return p.t < q.t;
    else
      return p.op < q.op;
  }
} op[500000];
int opi;
struct NODE {
  int max, plus;
} itree[1100000];
int S = 524288;
int gugan[1100000][2];
int live[300000];
int rlive[300000];
struct OP2 {
  int t, op, idx;
  bool operator()(OP2 p, OP2 q) {
    if (p.t != q.t)
      return p.t < q.t;
    else
      return p.op < q.op;
  }
} op2[300000];
int op2i;
void calcgugan(int now, int l, int r) {
  gugan[now][0] = l, gugan[now][1] = r;
  if (now >= S) return;
  calcgugan(now * 2, l, (l + r) / 2);
  calcgugan(now * 2 + 1, (l + r) / 2 + 1, r);
}
void recalc(int now) {
  if (now >= S) {
    itree[now].max = itree[now].plus;
    return;
  }
  itree[now].max = max(itree[now * 2].max, itree[now * 2 + 1].max);
  itree[now].max += itree[now].plus;
}
void update(int now, int l, int r, int p) {
  if (l > r) return;
  if (gugan[now][0] == l && gugan[now][1] == r) {
    itree[now].plus += p;
    recalc(now);
  } else {
    itree[now * 2].plus += itree[now].plus;
    itree[now * 2 + 1].plus += itree[now].plus;
    itree[now].plus = 0;
    recalc(now * 2);
    recalc(now * 2 + 1);
    update(now * 2, l, min(r, gugan[now * 2][1]), p);
    update(now * 2 + 1, max(l, gugan[now * 2 + 1][0]), r, p);
    recalc(now);
  }
}
int main() {
  int i, j, k;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d%d%d", &a[i].l, &a[i].v, &a[i].r);
  for (i = 0; i < n; i++) {
    op[opi].t = a[i].l;
    op[opi].op = 1;
    op[opi].idx = i;
    opi++;
    op[opi].t = a[i].v;
    op[opi].op = 2;
    op[opi].idx = i;
    opi++;
  }
  sort(op, op + opi, OP());
  calcgugan(1, 0, S - 1);
  int max = 0, maxi;
  for (i = 0; i < opi; i++) {
    int l, r, p;
    if (op[i].op == 1)
      p = 1;
    else
      p = -1;
    l = a[op[i].idx].v;
    r = a[op[i].idx].r;
    update(1, l, r, p);
    if (max < itree[1].max) {
      max = itree[1].max;
      maxi = i;
    }
  }
  for (i = 0; i <= maxi; i++) {
    if (op[i].op == 1)
      live[op[i].idx]++;
    else
      live[op[i].idx]--;
  }
  for (i = 0; i < n; i++) {
    if (!live[i]) continue;
    op2[op2i].t = a[i].v;
    op2[op2i].op = 1;
    op2[op2i].idx = i;
    op2i++;
    op2[op2i].t = a[i].r;
    op2[op2i].op = 2;
    op2[op2i].idx = i;
    op2i++;
  }
  sort(op2, op2 + op2i, OP2());
  int cnt = 0;
  for (i = 0; i < op2i; i++) {
    if (op2[i].op == 1)
      rlive[op2[i].idx]++, cnt++;
    else
      rlive[op2[i].idx]--, cnt--;
    if (cnt == max) {
      break;
    }
  }
  printf("%d\n", max);
  for (i = 0; i < n; i++) {
    if (rlive[i]) printf("%d ", i + 1);
  }
  return 0;
}