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 maxn = 100010;
int ans[maxn];
struct Record {
  int l, v, r, id;
} a[maxn], b[maxn];
struct Tree {
  int l, r, chg, opt;
  Tree *lc, *rc;
  Tree(int _l, int _r) : l(_l), r(_r) {
    chg = opt = 0;
    lc = l + 1 < r ? new Tree(l, (l + r) >> 1) : NULL;
    rc = l + 1 < r ? new Tree((l + r) >> 1, r) : NULL;
  }
  void down() {
    lc->chg += chg;
    lc->opt += chg;
    rc->chg += chg;
    rc->opt += chg;
    chg = 0;
  }
  int query(int ll, int rr) {
    if (ll <= l && rr >= r) return opt;
    if (chg) down();
    int res = 0;
    if (ll < (l + r) >> 1) res = max(res, lc->query(ll, rr));
    if (rr > (l + r) >> 1) res = max(res, rc->query(ll, rr));
    opt = max(lc->opt, rc->opt);
    return res;
  }
  void change(int ll, int rr, int x) {
    if (ll <= l && rr >= r) {
      chg += x;
      opt += x;
      return;
    }
    down();
    if (ll < (l + r) >> 1) lc->change(ll, rr, x);
    if (rr > (l + r) >> 1) rc->change(ll, rr, x);
    opt = max(lc->opt, rc->opt);
  }
  void clear() {
    chg = opt = 0;
    if (lc != NULL) lc->clear();
    if (rc != NULL) rc->clear();
  }
  int which(int ll, int rr, int x) {
    if (l + 1 == r) return l + 1;
    if (chg) down();
    if (ll < (l + r) >> 1 && lc->query(ll, rr) == x)
      return lc->which(ll, rr, x);
    return rc->which(ll, rr, x);
  }
} * root;
bool cmp_l(Record u, Record v) { return u.l < v.l; }
bool cmp_v(Record u, Record v) { return u.v < v.v; }
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].l >> a[i].v >> a[i].r;
    a[i].id = i;
    b[i] = a[i];
  }
  sort(a, a + n, cmp_l);
  sort(b, b + n, cmp_v);
  root = new Tree(0, 300000);
  int res = 0;
  for (int i = 0, k = 0; i < n; i++) {
    for (; k < n && b[k].v < a[i].l; k++) root->change(b[k].v - 1, b[k].r, -1);
    root->change(a[i].v - 1, a[i].r, 1);
    res = max(res, root->query(a[i].l - 1, 300000));
  }
  root->clear();
  for (int i = 0, k = 0; i < n; i++) {
    for (; k < n && b[k].v < a[i].l; k++) root->change(b[k].v - 1, b[k].r, -1);
    root->change(a[i].v - 1, a[i].r, 1);
    if (res == root->query(a[i].l - 1, 300000)) {
      int whi = root->which(a[i].l - 1, 300000, res);
      memset(ans, 0, sizeof(ans));
      for (int j = 0; j <= i; j++)
        if (a[j].v <= whi && a[j].r >= whi && a[j].v >= a[i].l)
          ans[a[j].id] = 1;
      cout << res << endl;
      for (int j = 0; j < n; j++)
        if (ans[j]) cout << j + 1 << ' ';
      cout << endl;
      break;
    }
  }
  return 0;
}