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;
int dx[] = {0, 0, 1, -1, 1, -1, 1, -1}, dy[] = {-1, 1, 0, 0, 1, -1, -1, 1};
void run();
int main() {
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(16);
  run();
}
const int inf = 1 << 29;
const int maxl = 19;
int N = 1 << maxl;
struct Range {
  int max;
  int argmax;
  int lo, hi;
  int count() const { return hi - lo + 1; }
};
Range NULL_RANGE = {-inf, 0, inf, -inf};
Range operator+(const Range& l, const Range& r) {
  return {
      max(l.max, r.max),
      (l.max >= r.max && l.argmax != inf) ? l.argmax : r.argmax,
      min(l.lo, r.lo),
      max(l.hi, r.hi),
  };
}
enum ActionType { ACTION_ID = 0, ACTION_ADD };
struct Action {
  ActionType type;
  int val;
  Range apply(const Range& r) {
    if (type == ACTION_ID) return r;
    return {
        val + r.max,
        r.argmax,
        r.lo,
        r.hi,
    };
  }
};
Action NULL_ACTION = {ACTION_ID, 0};
Action operator+(const Action& a, const Action& b) {
  if (a.type == ACTION_ID) return b;
  if (b.type == ACTION_ID) return a;
  return (Action){ACTION_ADD, a.val + b.val};
}
int left(int i) { return 2 * i; }
int right(int i) { return 2 * i + 1; }
struct Node {
  Range r;
  Action action;
  Range range() { return action.apply(r); }
} t[1 << (maxl + 1)];
void maintain(int i) {
  t[i].r = t[left(i)].range() + t[right(i)].range();
  t[i].action = NULL_ACTION;
}
void update(int x, const Action& a, int ql, int qr);
void push_down(int x) {
  update(left(x), t[x].action, -inf, inf);
  update(right(x), t[x].action, -inf, inf);
  t[x].r = t[x].action.apply(t[x].r);
  t[x].action = NULL_ACTION;
}
void update(int x, const Action& a, int ql, int qr) {
  if (t[x].r.hi < ql || t[x].r.lo > qr) return;
  if (ql <= t[x].r.lo && t[x].r.hi <= qr) {
    t[x].action = t[x].action + a;
    return;
  }
  push_down(x);
  update(left(x), a, ql, qr);
  update(right(x), a, ql, qr);
  maintain(x);
}
Range query(int x, int ql, int qr) {
  if (t[x].r.hi < ql || t[x].r.lo > qr) return NULL_RANGE;
  if (ql <= t[x].r.lo && t[x].r.hi <= qr) return t[x].range();
  push_down(x);
  return query(left(x), ql, qr) + query(right(x), ql, qr);
}
void init() {
  for (int i = (0); i < (N); ++i) t[N + i].r.lo = t[N + i].r.hi = i;
  for (int i = N - 1; i >= 1; --i) maintain(i);
}
const int maxn = 100100;
int n;
int l[maxn], v[maxn], r[maxn];
void run() {
  for (int i = (0); i < (N); ++i)
    t[N + i].r.max = 0, t[N + i].r.argmax = i,
          t[N + i].action = (Action){ACTION_ID, 0};
  init();
  cin >> n;
  vector<pair<int, int> > evts;
  for (int i = (0); i < (n); ++i) {
    cin >> l[i] >> v[i] >> r[i];
    evts.push_back(make_pair(v[i], ~i));
    evts.push_back(make_pair(r[i], i));
  }
  sort(begin(evts), end(evts));
  int ans = -1;
  int bestl, bestr;
  for (auto it : evts) {
    if (it.second < 0) {
      int i = ~it.second;
      update(1, {ACTION_ADD, 1}, l[i], v[i]);
    } else {
      int i = it.second;
      update(1, {ACTION_ADD, -1}, l[i], v[i]);
    }
    Range r = query(1, 0, 300001);
    if (r.max > ans) {
      ans = r.max;
      bestr = it.first;
      bestl = r.argmax;
    }
  }
  cout << ans << "\n";
  for (int i = (0); i < (n); ++i)
    if (v[i] >= bestl && bestl >= l[i] && v[i] <= bestr && bestr <= r[i])
      cout << i + 1 << " ";
  cout << "\n";
}