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 MX = 100005, INF = 1000000000, mod = 1000000007;
const long long int LINF = 1000000000000000000ll;
const double eps = 1e-10;
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, -1, 0, 1};
int x[MX], y[MX], z[MX];
pair<int, int> e[MX * 2];
struct seg {
  vector<int> d;
  int sz, sz2;
  seg() {}
  seg(int mx) {
    sz = 1;
    while (sz < mx) sz <<= 1;
    sz2 = sz << 1;
    d.resize(sz2);
    init(mx);
  }
  void init(int mx) {
    sz = 1;
    while (sz < mx) sz <<= 1;
    sz2 = sz << 1;
    fill(d.begin(), d.end(), 0);
  }
  void qu(int a, int b, int x, int i = 1, int l = 0, int r = INF) {
    if (r == INF) r = sz;
    if (a <= l && r <= b) {
      d[i] += x;
      return;
    }
    if (b <= l && r <= a) return;
    int c = l + r >> 1, lc = i << 1, rc = lc + 1;
    if (a < c) qu(a, b, x, lc, l, c);
    if (c < b) qu(a, b, x, rc, c, r);
    if (d[lc] > 0) {
      d[i] += d[lc];
      d[rc] -= d[lc];
      d[lc] = 0;
    }
    if (d[rc] > 0) {
      d[i] += d[rc];
      d[lc] -= d[rc];
      d[rc] = 0;
    }
    if (d[lc] < 0 && d[rc] < 0) {
      int nxt = max(d[lc], d[rc]);
      d[lc] -= nxt;
      d[rc] -= nxt;
      d[i] += nxt;
    }
    return;
  }
  int qw() {
    int i = 1;
    while (i < sz) {
      i <<= 1;
      if (d[i | 1] == 0) i |= 1;
    }
    return i - sz;
  }
};
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d%d%d", &x[i], &y[i], &z[i]);
  int ei = 0;
  for (int i = 0; i < n; i++) {
    e[ei++] = pair<int, int>(x[i], i);
    e[ei++] = pair<int, int>(y[i], i + n);
  }
  sort(e, e + ei);
  int ans = 0, ansi = 0;
  seg t(3 * MX);
  for (int i = 0; i < ei; i++) {
    int ni = e[i].second % n, ne = e[i].second / n;
    if (!ne) {
      t.qu(y[ni], z[ni] + 1, 1);
      if (ans < t.d[1]) {
        ans = t.d[1];
        ansi = i;
      }
    } else {
      t.qu(y[ni], z[ni] + 1, -1);
    }
  }
  printf("%d\n", ans);
  t.init(3 * MX);
  for (int i = 0; i < ansi + 1; i++) {
    int ni = e[i].second % n, ne = e[i].second / n;
    if (!ne) {
      t.qu(y[ni], z[ni] + 1, 1);
    } else {
      t.qu(y[ni], z[ni] + 1, -1);
    }
  }
  int ap = t.qw(), al = e[ansi].first, now = 0;
  for (int i = 0; i < n; i++) {
    if (x[i] <= al && y[i] >= al && z[i] >= ap && y[i] <= ap) {
      now++;
      printf("%d%c", i + 1, now == ans ? '\n' : ' ');
    }
  }
  return 0;
}