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 = 600005;
int n;
struct node {
  int l, v, r;
} nd[MAXN];
int tree[MAXN * 2];
int lazy[MAXN * 2];
void push(int node, int st, int ed) {
  tree[node] += lazy[node];
  if (st != ed) {
    lazy[node * 2] += lazy[node];
    lazy[node * 2 + 1] += lazy[node];
  }
  lazy[node] = 0;
}
void update(int node, int st, int ed, int l, int r, int val) {
  push(node, st, ed);
  if (st > r || ed < l) {
    return;
  }
  if (st >= l && ed <= r) {
    lazy[node] += val;
    push(node, st, ed);
    return;
  }
  update(node * 2, st, (st + ed) / 2, l, r, val);
  update(node * 2 + 1, (st + ed) / 2 + 1, ed, l, r, val);
  tree[node] = max(tree[node * 2], tree[node * 2 + 1]);
}
int query(int node, int st, int ed, int l, int r) {
  push(node, st, ed);
  if (st > r || ed < l) {
    return 0;
  }
  if (st >= l && ed <= r) {
    return tree[node];
  }
  auto L = query(node * 2, st, (st + ed) / 2, l, r);
  auto R = query(node * 2 + 1, (st + ed) / 2 + 1, ed, l, r);
  return max(L, R);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> nd[i].l >> nd[i].v >> nd[i].r;
  }
  vector<pair<int, int> > event;
  for (int i = 1; i <= n; i++) {
    event.push_back(make_pair(nd[i].l, -i));
    event.push_back(make_pair(nd[i].v, i));
  }
  sort(event.begin(), event.end());
  int ans = 0;
  for (int i = 0; i < event.size(); i++) {
    int idx = event[i].second;
    if (idx < 0) {
      idx *= -1;
      update(1, 1, 300000, nd[idx].v, nd[idx].r, 1);
      ans = max(ans, query(1, 1, 300000, 1, 300000));
    } else {
      update(1, 1, 300000, nd[idx].v, nd[idx].r, -1);
      ans = max(ans, query(1, 1, 300000, 1, 300000));
    }
  }
  memset(tree, 0, sizeof(tree));
  memset(lazy, 0, sizeof(lazy));
  set<int> id;
  vector<int> go;
  int temp = 0;
  cout << ans << "\n";
  for (int i = 0; i < event.size(); i++) {
    int idx = event[i].second;
    if (idx < 0) {
      idx *= -1;
      id.insert(idx);
      update(1, 1, 300000, nd[idx].v, nd[idx].r, 1);
      temp = max(temp, query(1, 1, 300000, 1, 300000));
      if (temp == ans) {
        int q = 0;
        for (int j = 1; j <= 300000; j++) {
          if (query(1, 1, 300000, j, j) == temp) {
            q = j;
            break;
          }
        }
        for (auto it : id) {
          if (nd[it].v <= q && nd[it].r >= q) {
            go.push_back(it);
          }
        }
        for (auto x : go) {
          cout << x << ' ';
        }
        exit(0);
      }
    } else {
      id.erase(idx);
      update(1, 1, 300000, nd[idx].v, nd[idx].r, -1);
      temp = max(temp, query(1, 1, 300000, 1, 300000));
    }
  }
  return 0;
}