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 data {
  int l, orgIndex;
  bool entry;
  data() {}
  data(int l1, int orgIndex1, bool entry1 = false) {
    l = l1, entry = entry1;
    orgIndex = orgIndex1;
  }
} v[2 * 100005];
struct mdata {
  int l, r, v;
  mdata() {}
  mdata(int l1, int v1, int r1) : l(l1), r(r1), v(v1) {}
} org[100005];
bool cmp(data a, data b) {
  if (a.l < b.l) return 1;
  if (a.l == b.l) {
    return !b.entry;
  }
  return 0;
}
int tree[10 * 300005], lazy[10 * 300005], mxIndex[10 * 300005];
bool pending[10 * 300005];
int maxpos = 0, curmax = 0;
inline void push_down(int& node) {
  if (!pending[node]) return;
  tree[node] += lazy[node];
  pending[node] = 0;
  lazy[node << 1] += lazy[node];
  lazy[(node << 1) + 1] += lazy[node];
  lazy[node] = 0;
  pending[node << 1] = pending[(node << 1) + 1] = 1;
}
void build(int node, int l, int r) {
  if (l > r) return;
  if (l == r) {
    mxIndex[node] = l;
    return;
  }
  mxIndex[node] = l;
  int mid = (l + r) >> 1;
  build(node << 1, l, mid);
  build((node << 1) + 1, mid + 1, r);
  return;
}
void update(int node, int l, int r, int ll, int rr, int val) {
  if (ll > rr) return;
  if (l == ll && r == rr) {
    lazy[node] += val;
    pending[node] = 1;
    push_down(node);
    return;
  }
  int mid = (l + r) / 2;
  int nodeL = (node << 1), nodeR = (node << 1) + 1;
  push_down(node);
  update(nodeL, l, mid, ll, min(mid, rr), val);
  update(nodeR, mid + 1, r, max(mid + 1, ll), rr, val);
  push_down(nodeL);
  push_down(nodeR);
  if (tree[nodeL] > tree[nodeR]) {
    tree[node] = tree[nodeL];
    mxIndex[node] = mxIndex[nodeL];
  } else {
    tree[node] = tree[nodeR];
    mxIndex[node] = mxIndex[nodeR];
  }
  return;
}
int res[100005], rescnt = 0;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int l, r, val;
    scanf("%d %d %d", &l, &val, &r);
    org[i] = mdata(l, val, r);
    v[i] = data(l, i, 1);
    v[i + n] = data(val, i, 0);
  }
  sort(v, v + 2 * n, cmp);
  memset(lazy, 0, sizeof lazy);
  memset(tree, 0, sizeof tree);
  memset(pending, 0, sizeof pending);
  build(1, 0, 300005 - 1);
  int resL = 0, resR = 0;
  for (int i = 0; i < 2 * n; i++) {
    int ii = v[i].orgIndex;
    if (v[i].entry) {
      update(1, 0, 300005 - 1, org[ii].v, org[ii].r, 1);
    } else {
      update(1, 0, 300005 - 1, org[ii].v, org[ii].r, -1);
    }
    if (tree[1] > curmax) {
      curmax = tree[1];
      resL = org[ii].l, resR = mxIndex[1];
    }
  }
  for (int i = 0; i < n; i++) {
    int l = org[i].l, v = org[i].v, r = org[i].r;
    if (l <= resL && v >= resL && v <= resR && r >= resR) {
      res[rescnt++] = i + 1;
    }
  }
  printf("%d\n", rescnt);
  for (int i = 0; i < rescnt; i++) {
    if (i != 0) printf(" ");
    printf("%d", res[i]);
  }
  return 0;
}