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>
namespace in {
char buf[1 << 21], *p1 = buf, *p2 = buf;
inline int getc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
template <typename T>
inline void read(T& t) {
  t = 0;
  int f = 0;
  char ch = getc();
  while (!isdigit(ch)) {
    if (ch == '-') f = 1;
    ch = getc();
  }
  while (isdigit(ch)) {
    t = t * 10 + ch - 48;
    ch = getc();
  }
  if (f) t = -t;
}
template <typename T, typename... Args>
inline void read(T& t, Args&... args) {
  read(t);
  read(args...);
}
}  // namespace in
namespace out {
char buffer[1 << 21];
int p1 = -1;
const int p2 = (1 << 21) - 1;
inline void flush() { fwrite(buffer, 1, p1 + 1, stdout), p1 = -1; }
inline void putc(const char& x) {
  if (p1 == p2) flush();
  buffer[++p1] = x;
}
template <typename T>
void write(T x) {
  static char buf[15];
  static int len = -1;
  if (x >= 0) {
    do {
      buf[++len] = x % 10 + 48, x /= 10;
    } while (x);
  } else {
    putc('-');
    do {
      buf[++len] = -(x % 10) + 48, x /= 10;
    } while (x);
  }
  while (len >= 0) putc(buf[len]), --len;
}
}  // namespace out
using namespace std;
const int N = 5e5 + 10;
struct node {
  pair<long long, int> ans;
  long long tag;
  int l, r;
} T[N * 8];
void pushup(int x) { T[x].ans = max(T[(x << 1)].ans, T[(x << 1 | 1)].ans); }
void pushdown(int x) {
  if (T[x].tag) {
    T[(x << 1)].tag += T[x].tag;
    T[(x << 1)].ans.first += T[x].tag;
    T[(x << 1 | 1)].tag += T[x].tag;
    T[(x << 1 | 1)].ans.first += T[x].tag;
    T[x].tag = 0;
  }
}
void build(int x, int l, int r) {
  T[x].l = l, T[x].r = r;
  if (l == r) {
    T[x].ans = {0, l};
    return;
  }
  int mid = l + r >> 1;
  build((x << 1), l, mid);
  build((x << 1 | 1), mid + 1, r);
  pushup(x);
}
pair<long long, int> query(int x, int l, int r) {
  if (l <= T[x].l && T[x].r <= r) return T[x].ans;
  pushdown(x);
  int mid = T[x].l + T[x].r >> 1;
  if (r <= mid) return query((x << 1), l, r);
  if (mid < l) return query((x << 1 | 1), l, r);
  return max(query((x << 1), l, r), query((x << 1 | 1), l, r));
}
void upd(int x, int l, int r, int val) {
  if (l <= T[x].l && T[x].r <= r) {
    T[x].ans.first += val;
    T[x].tag += val;
    return;
  }
  pushdown(x);
  int mid = T[x].l + T[x].r >> 1;
  if (l <= mid) upd((x << 1), l, r, val);
  if (mid < r) upd((x << 1 | 1), l, r, val);
  pushup(x);
}
int n;
struct Worker {
  int l, r, v;
  Worker(int l, int v, int r) : l(l), v(v), r(r) {}
};
vector<Worker> a;
vector<vector<pair<pair<int, int>, int>>> opt;
signed main() {
  in::read(n);
  opt = vector<vector<pair<pair<int, int>, int>>>(3e5 + 4);
  for (int i = 1, l, v, r; i <= n; i++)
    in::read(l, v, r), a.push_back(Worker(l, v, r)),
        opt[l].push_back({{v, r}, 1}), opt[v + 1].push_back({{v, r}, -1});
  build(1, 0, 3e5);
  int ans = 0, x, y;
  for (int i = 0; i <= 3e5 + 3; i++) {
    for (auto OPT : opt[i])
      upd(1, OPT.first.first, OPT.first.second, OPT.second);
    if (T[1].ans.first > ans) ans = T[1].ans.first, x = i, y = T[1].ans.second;
  }
  printf("%d\n", ans);
  int tmp = 0;
  for (auto worker : a)
    if (++tmp && worker.l <= x && x <= worker.v && worker.v <= y &&
        y <= worker.r)
      printf("%d ", tmp);
}