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;
void desperate_optimization(int precision) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout.setf(ios::fixed);
  cout.setf(ios::showpoint);
  cout.precision(precision);
}
struct people {
  int l, r, v;
};
const int N = 3e5;
struct dat {
  int maxi;
  int id;
};
int lazy[4 * N + 5];
dat ST[4 * N + 5];
people arr[N + 5];
vector<pair<int, int> > lst;
priority_queue<pair<int, int> > timeline;
inline void pushdown(int idx) {
  if (lazy[idx] == 0) return;
  ST[2 * idx].maxi += lazy[idx];
  ST[2 * idx + 1].maxi += lazy[idx];
  lazy[2 * idx] += lazy[idx];
  lazy[2 * idx + 1] += lazy[idx];
  lazy[idx] = 0;
}
inline dat merge(dat A, dat B) {
  dat C;
  if (A.maxi == B.maxi) {
    C.maxi = A.maxi;
    C.id = max(A.id, B.id);
    return C;
  }
  C.maxi = max(A.maxi, B.maxi);
  if (C.maxi == A.maxi)
    C.id = A.id;
  else
    C.id = B.id;
  return C;
}
void build(int idx, int left, int right) {
  if (left == right) {
    ST[idx].maxi = 0;
    ST[idx].id = left;
    return;
  }
  int mid = (left + right) / 2;
  build(2 * idx, left, mid), build(2 * idx + 1, mid + 1, right);
  ST[idx] = merge(ST[2 * idx], ST[2 * idx + 1]);
}
void update(int idx, int left, int right, int l, int r, int val) {
  if (r < left || right < l) return;
  if (l <= left && right <= r) {
    ST[idx].maxi += val;
    lazy[idx] += val;
    return;
  }
  pushdown(idx);
  int mid = (left + right) / 2;
  update(2 * idx, left, mid, l, r, val);
  update(2 * idx + 1, mid + 1, right, l, r, val);
  ST[idx] = merge(ST[2 * idx], ST[2 * idx + 1]);
}
dat zero;
dat query(int idx, int left, int right, int l, int r) {
  if (right < l || r < left) return zero;
  if (l <= left && right <= r) return ST[idx];
  pushdown(idx);
  int mid = (left + right) / 2;
  return merge(query(2 * idx, left, mid, l, r),
               query(2 * idx + 1, mid + 1, right, l, r));
}
void hora(int tc) {
  zero.maxi = 0, zero.id = N;
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i].l >> arr[i].v >> arr[i].r;
    lst.push_back({arr[i].l, i});
  }
  sort(lst.begin(), lst.end());
  int maxi = -1, idr = -1, idl = -1;
  build(1, 1, N);
  for (int i = 0; i < lst.size(); i++) {
    int waktu = lst[i].first;
    int id = lst[i].second;
    while (!timeline.empty() && -timeline.top().first < waktu) {
      int cur_id = timeline.top().second;
      update(1, 1, N, arr[cur_id].v, arr[cur_id].r, -1);
      timeline.pop();
    }
    update(1, 1, N, arr[id].v, arr[id].r, 1);
    dat res = query(1, 1, N, waktu, N);
    if (res.maxi > maxi) {
      maxi = res.maxi;
      idl = waktu, idr = res.id;
    }
    timeline.push({-arr[id].v, id});
  }
  int ctr = 0;
  for (int i = 1; i <= n; i++) {
    if (arr[i].l <= idl && idr <= arr[i].r && idl <= arr[i].v &&
        arr[i].v <= idr)
      ctr++;
  }
  assert(ctr == maxi);
  cout << maxi << '\n';
  for (int i = 1; i <= n; i++) {
    if (arr[i].l <= idl && idr <= arr[i].r && idl <= arr[i].v &&
        arr[i].v <= idr)
      cout << i << " ";
  }
}
int main() {
  desperate_optimization(10);
  int ntc = 1;
  for (int tc = 1; tc <= ntc; tc++) hora(tc);
  return 0;
}