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 comment(linker, "/STACK:100000000000,100000000000")
using namespace std;
const double eps = 1E-9;
const double Exp = 2.718281828459045;
const double Pi = 3.1415926535897932;
const int NMAX = 100000 + 5;
const int MMAX = 1200000 + 5;
const int INF = 1000000000;
const int BASE = 1000000007;
template <typename T>
inline T abs(const T& a) {
  if (a < 0) a = -a;
  return a;
}
template <typename T>
inline T sqr(const T& a) {
  return a * a;
}
struct item {
  pair<int, int> v;
  int add;
} t[MMAX];
void push(int v, int tl, int tr) {
  int tm = (tl + tr) / 2;
  if (tl != tr) {
    t[2 * v].add += t[v].add;
    t[2 * v + 1].add += t[v].add;
  }
  t[v].v.first += t[v].add;
  t[v].add = 0;
}
void make(int v, int tl, int tr) {
  if (tl == tr) {
    t[v].v.first = 0;
    t[v].v.second = tl;
    t[v].add = 0;
  } else {
    int tm = (tl + tr) / 2;
    make(2 * v, tl, tm);
    make(2 * v + 1, tm + 1, tr);
    t[v].v.first = 0;
    t[v].v.second = tl;
    t[v].add = 0;
  }
}
void modify(int v, int tl, int tr, int l, int r, int x) {
  if (l == tl && r == tr) {
    t[v].add += x;
    push(v, tl, tr);
  } else {
    int tm = (tl + tr) / 2;
    push(v, tl, tr);
    if (r <= tm) {
      modify(2 * v, tl, tm, l, r, x);
      push(2 * v + 1, tm + 1, tr);
    } else if (l >= tm + 1) {
      push(2 * v, tl, tm);
      modify(2 * v + 1, tm + 1, tr, l, r, x);
    } else {
      modify(2 * v, tl, tm, l, tm, x);
      modify(2 * v + 1, tm + 1, tr, tm + 1, r, x);
    }
    t[v].v = max(t[2 * v].v, t[2 * v + 1].v);
    if (t[v].v.first < 0 || t[v].v.second < tl || t[v].v.second > tr) {
      cout << "FAIL " << v << endl;
    }
  }
}
pair<int, int> query(int v, int tl, int tr, int l, int r) {
  push(v, tl, tr);
  if (t[v].v.first < 0 || t[v].v.second < tl || t[v].v.second > tr) {
    cout << "FAIL " << v << endl;
  }
  if (l == tl && r == tr) {
    return t[v].v;
  }
  int tm = (tl + tr) / 2;
  if (r <= tm) return query(2 * v, tl, tm, l, r);
  if (l >= tm + 1) return query(2 * v + 1, tm + 1, tr, l, r);
  return max(query(2 * v, tl, tm, l, tm),
             query(2 * v + 1, tm + 1, tr, tm + 1, r));
}
int main() {
  ios::sync_with_stdio(true);
  int n;
  int i, j;
  static int l[NMAX];
  static int r[NMAX];
  static int v[NMAX];
  int c = 0;
  int mn = 0;
  static pair<int, pair<int, int> > e[2 * NMAX];
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d%d%d", &l[i], &v[i], &r[i]);
    mn = max(mn, r[i]);
  }
  for (i = 0; i < n; i++) {
    e[c].first = l[i];
    e[c].second.first = 1;
    e[c++].second.second = i;
    e[c].first = v[i] + 1;
    e[c].second.first = -1;
    e[c++].second.second = i;
  }
  sort(e, e + c);
  int ml, mr;
  int mx = 0;
  int curl;
  int k = 0;
  pair<int, int> curx;
  make(1, 1, mn);
  for (i = 0; i < c;) {
    curl = e[i].first;
    while (i < c && curl == e[i].first) {
      modify(1, 1, mn, v[e[i].second.second], r[e[i].second.second],
             e[i].second.first);
      i++;
    }
    curx = query(1, 1, mn, 1, mn);
    if (mx < curx.first) {
      mx = curx.first;
      ml = curl;
      mr = curx.second;
    }
  }
  cout << mx << endl;
  for (i = 0; i < n; i++) {
    if (l[i] <= ml && ml <= v[i] && v[i] <= mr && mr <= r[i])
      cout << i + 1 << " ";
  }
  cout << endl;
  return 0;
}