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;
const int INF = ~0U >> 1;
const int mx = 300000;
const int MAXN = 100005;
struct node {
  int l, v, r, id;
} a[MAXN], b[MAXN];
bool cmp(node a, node b) { return a.l < b.l; }
bool cmp2(node a, node b) { return a.v < b.v; }
int co[(mx << 2) + 5];
int Mx[(mx << 2) + 5];
int po[(mx << 2) + 5];
void pushup(int o) {
  if (Mx[o << 1] >= Mx[o << 1 | 1]) {
    Mx[o] = Mx[o << 1];
    po[o] = po[o << 1];
  } else {
    Mx[o] = Mx[o << 1 | 1];
    po[o] = po[o << 1 | 1];
  }
}
void pushdown(int o) {
  if (co[o] != 0) {
    co[o << 1] += co[o];
    co[o << 1 | 1] += co[o];
    Mx[o << 1] += co[o];
    Mx[o << 1 | 1] += co[o];
    co[o] = 0;
  }
}
void build(int l, int r, int o) {
  if (l == r) {
    po[o] = l;
    return;
  }
  int m = l + r >> 1;
  build(l, m, o << 1);
  build(m + 1, r, o << 1 | 1);
  pushup(o);
}
void update(int l, int r, int o, int L, int R, int v) {
  if (L <= l && r <= R) {
    Mx[o] += v;
    co[o] += v;
    return;
  }
  pushdown(o);
  int m = l + r >> 1;
  if (L <= m) update(l, m, o << 1, L, R, v);
  if (m < R) update(m + 1, r, o << 1 | 1, L, R, v);
  pushup(o);
}
vector<int> ans;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", &a[i].l, &a[i].v, &a[i].r);
    a[i].id = i;
    b[i] = a[i];
  }
  sort(a + 1, a + n + 1, cmp);
  sort(b + 1, b + n + 1, cmp2);
  int it = 1, it2 = 1;
  int cnt = 0;
  int L, R;
  build(1, mx, 1);
  for (int i = 1; i <= mx; i++) {
    while (it <= n && a[it].l <= i) {
      update(1, mx, 1, a[it].v, a[it].r, 1);
      ++it;
    }
    int res = Mx[1];
    if (res > cnt) {
      cnt = res;
      L = i;
      R = po[1];
    }
    while (it2 <= n && b[it2].v <= i) {
      update(1, mx, 1, b[it2].v, b[it2].r, -1);
      ++it2;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i].l <= L && a[i].r >= R && a[i].v >= L && a[i].v <= R)
      ans.push_back(a[i].id);
  }
  L = ans.size();
  printf("%d\n", L);
  for (int i = 0; i < L; i++) printf("%d ", ans[i]);
  puts("");
  return 0;
}