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 worker {
  int l, v, r, id;
  worker(int l, int v, int r, int id) : l(l), v(v), r(r), id(id) {}
  void dbg() { cout << l << ' ' << v << ' ' << r << ' ' << id << '\n'; }
  bool operator<(const worker& q) const {
    if (r == q.r) {
      if (l == q.l) return v < q.v;
      return l < q.l;
    }
    return r > q.r;
  }
};
const int maxn = 300005;
int n, lzy[4 * maxn];
pair<int, int> it[4 * maxn];
priority_queue<pair<int, int> > pq;
vector<worker> a;
void lazy(int node, int l, int r) {
  if (!lzy[node]) return;
  it[node].first += lzy[node];
  if (l != r) {
    lzy[node * 2] += lzy[node];
    lzy[node * 2 + 1] += lzy[node];
  }
  lzy[node] = 0;
}
void build(int node, int l, int r) {
  if (l > r) return;
  if (l == r) {
    it[node].second = l;
    return;
  }
  build(node * 2, l, (l + r) / 2);
  build(node * 2 + 1, (l + r) / 2 + 1, r);
  it[node] = max(it[node * 2], it[node * 2 + 1]);
}
void upd(int node, int l, int r, int ll, int rr, int v) {
  lazy(node, l, r);
  if (l > r || ll > r || l > rr) return;
  if (ll <= l && r <= rr) {
    lzy[node] = v;
    lazy(node, l, r);
    return;
  }
  upd(node * 2, l, (l + r) / 2, ll, rr, v);
  upd(node * 2 + 1, (l + r) / 2 + 1, r, ll, rr, v);
  it[node] = max(it[node * 2], it[node * 2 + 1]);
}
pair<int, int> get(int node, int l, int r, int ll, int rr) {
  if (l > r || ll > r || l > rr) return pair<int, int>(0, 0);
  if (ll <= l && r <= rr) return it[node];
  return max(get(node * 2, l, (l + r) / 2, ll, rr),
             get(node * 2 + 1, (l + r) / 2 + 1, r, ll, rr));
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int l, v, r;
    cin >> l >> v >> r;
    a.push_back(worker(l, v, r, i + 1));
  }
  build(1, 1, 300000);
  sort(a.begin(), a.end());
  int ans = 0, ansL = 0, ansR = 0;
  for (int i = 0; i < n; ++i) {
    while (pq.size() && pq.top().first > a[i].r) {
      int id = pq.top().second;
      pq.pop();
      upd(1, 1, 300000, a[id].l, a[id].v, -1);
    }
    upd(1, 1, 300000, a[i].l, a[i].v, 1);
    pair<int, int> tmp = get(1, 1, 300000, a[i].l, a[i].v);
    if (tmp.first > ans) {
      ans = tmp.first;
      ansL = tmp.second;
      ansR = a[i].r;
    }
    pq.push(pair<int, int>(a[i].v, i));
  }
  vector<int> res;
  for (int i = 0; i < n; ++i) {
    if (a[i].l <= ansL && ansR <= a[i].r && ansL <= a[i].v && a[i].v <= ansR)
      res.push_back(a[i].id);
  }
  sort(res.begin(), res.end());
  cout << res.size() << '\n';
  for (int i = 0; i < res.size(); ++i) cout << res[i] << ' ';
}