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 = 2e5 + 6;
const int MAXM = 4e5 + 6;
pair<int, int> tree[4 * MAXM];
int lazy[4 * MAXM];
bool in[MAXN];
void build(int l, int r, int idx) {
  if (l > r) return;
  if (l == r) {
    tree[idx].first = 0;
    tree[idx].second = l;
    lazy[idx] = 0;
    return;
  }
  int mid = (l + r) / 2;
  build(l, mid, idx * 2);
  build(mid + 1, r, idx * 2 + 1);
  tree[idx] = max(tree[idx * 2], tree[idx * 2 + 1]);
}
void push(int l, int r, int idx) {
  tree[idx].first += lazy[idx];
  if (l != r) {
    lazy[idx * 2] += lazy[idx];
    lazy[idx * 2 + 1] += lazy[idx];
  }
  lazy[idx] = 0;
}
void update(int l, int r, int idx, int ql, int qr, int val) {
  push(l, r, idx);
  if (l > r) return;
  if (l > qr) return;
  if (r < ql) return;
  if (l >= ql && r <= qr) {
    lazy[idx] += val;
    push(l, r, idx);
    return;
  }
  int mid = (l + r) / 2;
  update(l, mid, idx * 2, ql, qr, val);
  update(mid + 1, r, idx * 2 + 1, ql, qr, val);
  tree[idx] = max(tree[idx * 2], tree[idx * 2 + 1]);
}
pair<int, int> query(int l, int r, int idx, int ql, int qr) {
  push(l, r, idx);
  if (l > qr) return {-1, -1};
  if (r < ql) return {-1, -1};
  if (l > r) return {-1, -1};
  if (l >= ql && r <= qr) {
    return tree[idx];
  }
  int mid = (l + r) / 2;
  return max(query(l, mid, idx * 2, ql, qr),
             query(mid + 1, r, idx * 2 + 1, ql, qr));
}
struct worker {
  int l, r, v, pos;
};
bool cmp1(worker w1, worker w2) {
  if (w1.l != w2.l) return w1.l < w2.l;
  if (w1.v != w2.v) return w1.v < w2.v;
  return w1.r < w2.r;
}
bool cmp2(worker w1, worker w2) {
  if (w1.v != w2.v) return w1.v < w2.v;
  if (w1.l != w2.l) return w1.l < w2.l;
  return w1.r < w2.r;
}
void add(worker w) {
  if (in[w.pos]) return;
  in[w.pos] = 1;
  update(1, MAXM - 1, 1, w.v, w.r, +1);
}
void remove(worker w) {
  if (!in[w.pos]) return;
  in[w.pos] = 0;
  update(1, MAXM - 1, 1, w.v, w.r, -1);
}
vector<worker> w;
vector<worker> w1, w2;
vector<pair<pair<int, int>, int> > events[MAXM];
int main() {
  int n;
  cin >> n;
  build(1, MAXM - 1, 1);
  for (int i = 1; i <= n; i++) {
    int l, v, r;
    cin >> l >> v >> r;
    w.push_back({l, r, v, i});
    w1.push_back({l, r, v, i});
    w2.push_back({l, r, v, i});
    events[l].push_back({{v, r}, 1});
    events[v + 1].push_back({{v, r}, -1});
  }
  sort(w1.begin(), w1.end(), cmp1);
  sort(w2.begin(), w2.end(), cmp2);
  int l1 = 0, i1 = 0, i2 = 0;
  int ans = 0, ansl, ansr;
  for (l1 = 0; l1 < MAXM; l1++) {
    for (auto t : events[l1]) {
      update(1, MAXM - 1, 1, t.first.first, t.first.second, t.second);
    }
    pair<int, int> q = query(1, MAXM - 1, 1, l1, MAXM - 1);
    if (q.first > ans) {
      ans = q.first;
      ansl = l1;
      ansr = q.second;
    }
  }
  vector<int> output;
  for (int i = 0; i < w.size(); i++) {
    if (w[i].v <= ansr && w[i].v >= ansl && w[i].l <= ansl && w[i].r >= ansr) {
      output.push_back(w[i].pos);
    }
  }
  if (ans != output.size()) {
    cout << ans << " " << output.size() << endl;
    assert(false);
  }
  cout << ans << endl;
  for (auto o : output) cout << o << " ";
  cout << endl;
  return 0;
}