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>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
struct tree {
  pair<int, int> x;
  int upd;
  tree* left;
  tree* right;
  tree(int l, int r) {
    this->x = {0, l};
    this->upd = 0;
    this->left = nullptr;
    this->right = nullptr;
  }
};
struct dot {
  tree* root;
  dot() { root = new tree(1, 1); }
  void push(tree* root, int l, int r) {
    if (l > r) return;
    if (l == r) {
      if (root->upd) {
        root->x.first += root->upd;
        root->upd = 0;
      }
      return;
    }
    int m = (l + r) / 2;
    if (root->left == nullptr) root->left = new tree(l, m);
    if (root->right == nullptr) root->right = new tree(m + 1, r);
    if (root->upd) {
      root->left->upd += root->upd;
      root->right->upd += root->upd;
      root->x.first += root->upd;
      root->upd = 0;
    }
  }
  void upd(tree* root, int l, int r, int l1, int r1, int x) {
    push(root, l, r);
    if (l > r || l1 > r || r1 < l) return;
    if (l == l1 && r == r1) {
      root->upd += x;
      push(root, l, r);
      return;
    }
    int m = (l + r) / 2;
    upd(root->left, l, m, l1, min(r1, m), x);
    upd(root->right, m + 1, r, max(m + 1, l1), r1, x);
    if (root->left->x.first > root->right->x.first)
      root->x = root->left->x;
    else
      root->x = root->right->x;
  }
  pair<int, int> mx(tree* root, int l, int r, int l1, int r1) {
    push(root, l, r);
    if (l > r || l1 > r || r1 < l) return {-1, -1};
    if (l == l1 && r == r1) return root->x;
    int m = (l + r) / 2;
    pair<int, int> x = mx(root->left, l, m, l1, min(r1, m));
    pair<int, int> y = mx(root->right, m + 1, r, max(m + 1, l1), r1);
    if (x.first > y.first) return x;
    return y;
  }
};
const int maxn = 2e5 + 113;
bool used[maxn];
void solve(vector<pair<pair<int, int>, int>> in, dot& ms) {
  vector<pair<int, int>> te;
  for (int i = 0; i < in.size(); i++) {
    te.push_back({in[i].first.first, i});
    te.push_back({in[i].second + 1, i});
  }
  sort(te.begin(), te.end());
  reverse(te.begin(), te.end());
  int ans = 0;
  int L, R;
  for (int le = 1; le <= 3e5; le++) {
    while (te.size() && te.back().first == le) {
      if (!used[te.back().second]) {
        used[te.back().second] = 1;
        ms.upd(ms.root, 1, 3e5, in[te.back().second].second,
               in[te.back().second].first.second, 1);
      } else {
        used[te.back().second] = 0;
        ms.upd(ms.root, 1, 3e5, in[te.back().second].second,
               in[te.back().second].first.second, -1);
      }
      te.pop_back();
    }
    pair<int, int> t = ms.mx(ms.root, 1, 3e5, 1, 3e5);
    if (ans < t.first) {
      ans = t.first;
      L = le, R = t.second;
    }
    if (!te.size()) break;
  }
  cout << ans << "\n";
  for (int i = 0; i < in.size(); i++) {
    if (in[i].first.first <= L && in[i].first.second >= R &&
        in[i].second >= L && in[i].second <= R)
      cout << i + 1 << " ";
  }
  return;
}
signed main() {
  srand(1337);
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  vector<pair<pair<int, int>, int>> in;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b, c;
    cin >> a >> b >> c;
    in.push_back({{a, c}, b});
  }
  dot ms;
  solve(in, ms);
  return 0;
}