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 N = 300005;
int tree[N * 4], lazy[N * 4];
int l[N], v[N], r[N];
vector<pair<int, int>> ds;
void build(int nd, int l, int r) {
  lazy[nd] = tree[nd] = 0;
  if (l == r) return;
  int m = (l + r) >> 1;
  int cc = nd << 1;
  build(cc, l, m);
  build(cc ^ 1, m + 1, r);
}
void push(int nd, int l, int r) {
  if (lazy[nd] == 0) return;
  if (l < r) {
    int cc = nd << 1;
    lazy[cc] += lazy[nd];
    lazy[cc ^ 1] += lazy[nd];
  }
  tree[nd] += lazy[nd];
  lazy[nd] = 0;
}
void update(int nd, int l, int r, int tr, int ph, int val) {
  push(nd, l, r);
  if (l > ph || r < tr) return;
  if (tr <= l && r <= ph) {
    lazy[nd] += val;
    push(nd, l, r);
    return;
  }
  int m = (l + r) >> 1;
  int cc = nd << 1;
  update(cc, l, m, tr, ph, val);
  update(cc ^ 1, m + 1, r, tr, ph, val);
  tree[nd] = max(tree[cc], tree[cc ^ 1]);
}
int query(int nd, int l, int r, int tr, int ph) {
  push(nd, l, r);
  if (l > ph || r < tr) return 0;
  if (tr <= l && r <= ph) {
    return tree[nd];
  }
  int m = (l + r) >> 1;
  int cc = nd << 1;
  return max(query(cc, l, m, tr, ph), query(cc ^ 1, m + 1, r, tr, ph));
}
int main() {
  int n;
  scanf("%d", &n);
  int mx = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d%d%d", l + i, v + i, r + i);
    ds.push_back({v[i], -i});
    ds.push_back({r[i], i});
    mx = max(mx, r[i]);
  }
  sort(ds.begin(), ds.end());
  int ans = 0, ansid = 0;
  build(1, 1, mx);
  for (auto &p : ds) {
    if (p.second < 0) {
      int id = -p.second;
      update(1, 1, mx, l[id], v[id], 1);
    } else {
      int id = p.second;
      int last = ans;
      ans = max(ans, query(1, 1, mx, 1, r[id]));
      if (last < ans) {
        ansid = id;
      }
      update(1, 1, mx, l[id], v[id], -1);
    }
  }
  printf("%d\n", ans);
  int i = 0;
  for (i = 0; i < ds.size(); i++)
    if (ds[i].second == ansid) {
      break;
    }
  set<pair<int, int>, greater<pair<int, int>>> ss;
  for (i--; i >= 0; i--) {
    if (ds[i].second > 0) {
      v[ds[i].second] = -1;
    } else {
      int id = -ds[i].second;
      if (v[id] < 0) continue;
      ss.insert({l[id], id});
      while (!ss.empty() && ss.begin()->first > v[id]) {
        ss.erase(ss.begin());
      }
      if (ss.size() == ans) break;
    }
  }
  assert(ss.size() == ans);
  for (auto &p : ss) printf("%d ", p.second);
}