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 MAX = 300003;
struct Node {
  int sum = 0;
  int mx = 0;
  int mn = 0;
};
Node zero;
const int inf = 3e7;
struct SegmentTree {
  vector<Node> tree;
  vector<int> lazy;
  int n, root, size;
  Node combine(const Node &L, const Node &R) {
    Node par;
    par.sum = L.sum + R.sum;
    par.mx = max(L.mx, R.mx);
    par.mn = min(L.mn, R.mn);
    return par;
  }
  void combineRange(int node, int start, int end, int delta) {
    tree[node].sum += (end - start + 1) * delta;
    tree[node].mx += delta;
    tree[node].mn += delta;
    if (start != end) {
      lazy[2 * node] += delta;
      lazy[2 * node + 1] += delta;
    }
  }
  SegmentTree(int currSize) : n((int)currSize), root(1) {
    size = 1;
    while (size < n) size <<= 1;
    size <<= 1;
    tree.resize(size);
    lazy.resize(size, 0);
  }
  SegmentTree(const vector<int> &arr) : n((int)arr.size()), root(1) {
    size = 1;
    while (size < n) size <<= 1;
    size <<= 1;
    tree.resize(size);
    lazy.resize(size, 0);
    build(arr, root, 0, n - 1);
  }
  void build(const vector<int> &arr, int node, int start, int end) {
    if (start == end) {
      tree[node].sum = arr[start];
      tree[node].mx = arr[start];
      tree[node].mn = arr[start];
    } else {
      int mid = (start + end) / 2;
      build(arr, 2 * node, start, mid);
      build(arr, 2 * node + 1, mid + 1, end);
      tree[node] = combine(tree[2 * node], tree[2 * node + 1]);
    }
  }
  void pendingUpdate(int node, int start, int end) {
    int &currLazy = lazy[node];
    if (currLazy) {
      combineRange(node, start, end, currLazy);
      currLazy = 0;
    }
  }
  void update(int l, int r, int diff) { update(root, 0, n - 1, l, r, diff); }
  void update(int node, int start, int end, int l, int r, int diff) {
    pendingUpdate(node, start, end);
    if (start > end || start > r || end < l) return;
    if (start >= l && end <= r) {
      combineRange(node, start, end, diff);
      return;
    }
    int mid = (start + end) / 2;
    update(2 * node, start, mid, l, r, diff);
    update(2 * node + 1, mid + 1, end, l, r, diff);
    tree[node] = combine(tree[2 * node], tree[2 * node + 1]);
  }
  Node query(int l, int r) { return query(root, 0, n - 1, l, r); }
  Node query(int node, int start, int end, int l, int r) {
    if (r < start || end < l) return zero;
    pendingUpdate(node, start, end);
    if (l <= start && end <= r) return tree[node];
    int mid = (start + end) / 2;
    return combine(query(2 * node, start, mid, l, r),
                   query(2 * node + 1, mid + 1, end, l, r));
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> l, c, r;
  for (int i = 0; i < n; i++) {
    int x, y, z;
    cin >> x >> y >> z;
    l.push_back(x);
    c.push_back(y);
    r.push_back(z);
  }
  vector<vector<pair<int, int>>> ranges_add(MAX);
  vector<vector<pair<int, int>>> ranges_rem(MAX);
  for (int i = 0; i < n; i++) {
    ranges_add[c[i]].push_back({l[i], c[i]});
    ranges_rem[r[i]].push_back({l[i], c[i]});
  }
  zero.sum = 0;
  zero.mx = -inf;
  zero.mn = inf;
  SegmentTree st(MAX);
  int bestrval = -1;
  int bestridx = -1;
  for (int i = 1; i < MAX; i++) {
    for (auto j : ranges_add[i]) {
      st.update(j.first, j.second, 1);
    }
    int val = st.query(1, MAX).mx;
    if (val > bestrval) {
      bestrval = val;
      bestridx = i;
    }
    for (auto j : ranges_rem[i]) {
      st.update(j.first, j.second, -1);
    }
  }
  vector<int> prefix(MAX, 0);
  for (int i = 0; i < n; i++) {
    if (c[i] <= bestridx && bestridx <= r[i]) {
      prefix[l[i]]++;
      prefix[c[i] + 1]--;
    }
  }
  int bestlval = -1;
  int bestlidx = -1;
  int sum = 0;
  for (int i = 0; i < MAX; i++) {
    sum += prefix[i];
    if (sum > bestlval) {
      bestlval = sum;
      bestlidx = i;
    }
  }
  cout << bestlval << endl;
  for (int i = 0; i < n; i++) {
    if (l[i] <= bestlidx && r[i] >= bestridx) {
      if (bestlidx <= c[i] && c[i] <= bestridx) {
        cout << i + 1 << " ";
      }
    }
  }
  cout << endl;
  return 0;
}