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;
long long modpow(long long b, long long e, long long mod) {
  long long ans = 1;
  for (; e; b = b * b % mod, e /= 2) {
    if (e & 1) ans = ans * b % mod;
  }
  return ans;
}
struct event {
  int x;
  int y1, y2;
  bool tp;
  bool operator<(const event& rhs) const {
    if (x == rhs.x) {
      return tp > rhs.tp;
    }
    return x < rhs.x;
  }
};
template <class T>
struct lazy_seg {
 public:
  vector<T> st;
  vector<int> lazy;
  lazy_seg(int n) {
    st.resize(4 * n + 1), lazy.resize(4 * n + 1, 0);
    build(1, 300000, 1);
  }
  lazy_seg() = default;
  void push(int l, int r, int curr) {
    if (lazy[curr] != 0) {
      st[curr].first += lazy[curr];
      if (l != r)
        lazy[2 * curr] += lazy[curr], lazy[2 * curr + 1] += lazy[curr];
      lazy[curr] = 0;
    }
  }
  void pull(int l, int r, int curr) {
    push(l, r, curr);
    int mid = l + (r - l) / 2;
    if (l != r) push(l, mid, 2 * curr), push(mid + 1, r, 2 * curr + 1);
    st[curr] = max(st[2 * curr], st[2 * curr + 1]);
  }
  void upd(int x, int y, int v, int l, int r, int curr) {
    int mid = (l + r) / 2;
    push(l, r, curr);
    if (l == x && r == y) {
      lazy[curr] += v;
      push(l, r, curr);
      return;
    }
    if (y <= mid)
      upd(x, y, v, l, mid, 2 * curr);
    else if (x > mid)
      upd(x, y, v, mid + 1, r, 2 * curr + 1);
    else
      upd(x, mid, v, l, mid, 2 * curr),
          upd(mid + 1, y, v, mid + 1, r, 2 * curr + 1);
    pull(l, r, curr);
  }
  T qry(int x, int y, int l, int r, int curr) {
    int mid = (l + r) / 2;
    push(l, r, curr);
    if (l == x && r == y) return st[curr];
    if (y <= mid)
      return qry(x, y, l, mid, 2 * curr);
    else if (x > mid)
      return qry(x, y, mid + 1, r, 2 * curr + 1);
    return max(qry(x, mid, l, mid, 2 * curr),
               qry(mid + 1, y, mid + 1, r, 2 * curr + 1));
  }
  void build(int l, int r, int curr) {
    int mid = (l + r) / 2;
    st[curr] = {0, l};
    if (l == r) {
      st[curr] = {0, l};
      return;
    }
    build(l, mid, 2 * curr);
    build(mid + 1, r, 2 * curr + 1);
    st[curr] = max(st[2 * curr], st[2 * curr + 1]);
  }
};
int32_t main() {
  int n, m;
  cin >> n;
  vector<array<int, 3> > v(n);
  vector<event> sw;
  for (int i = 0; i < n; i++) {
    cin >> v[i][0] >> v[i][1] >> v[i][2];
    sw.push_back({v[i][0], v[i][1], v[i][2], 0});
    sw.push_back({v[i][1] + 1, v[i][1], v[i][2], 1});
  }
  sort(begin(sw), end(sw));
  array<int, 3> opt = {0, 0, 0};
  const int ff = 400000;
  const int sz = 300000;
  lazy_seg<pair<int, int> > sweep(ff);
  for (auto w : sw) {
    if (w.tp == 0) {
      sweep.upd(w.y1, w.y2, +1, 1, sz, 1);
    } else {
      sweep.upd(w.y1, w.y2, -1, 1, sz, 1);
    }
    auto z = sweep.qry(1, sz, 1, sz, 1);
    array<int, 3> r = {z.first, w.x, z.second};
    if (opt[0] < z.first) {
      opt = r;
    }
  }
  cout << opt[0] << endl;
  int z = 0;
  for (int i = 0; i < n; i++) {
    if (v[i][0] <= opt[1] && opt[1] <= v[i][1] && v[i][1] <= opt[2] &&
        opt[2] <= v[i][2]) {
      cout << i + 1 << " ";
    }
  }
  cout << endl;
}