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 JAVA):

Solution:
// practice with rainboy
import java.io.*;
import java.util.*;

public class CF377D extends PrintWriter {
	CF377D() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		CF377D o = new CF377D(); o.main(); o.flush();
	}

	int[] dd, lz, xx; int h_, n_, x_;
	void put(int i, int d) {
		dd[i] += d;
		if (i < n_)
			lz[i] += d;
	}
	void pul(int i) {
		int l = i << 1, r = l | 1;
		if (dd[l] >= dd[r]) {
			dd[i] = dd[l]; xx[i] = xx[l];
		} else {
			dd[i] = dd[r]; xx[i] = xx[r];
		}
	}
	void build(int x) {
		h_ = 0;
		while (1 << h_ < x)
			h_++;
		n_ = 1 << h_;
		dd = new int[n_ * 2]; lz = new int[n_];
		xx = new int[n_ * 2];
		for (int i = 0; i < n_; i++)
			xx[n_ + i] = i;
		for (int i = n_ - 1; i > 0; i--)
			pul(i);
	}
	void push(int i) {
		for (int h = h_; h > 0; h--) {
			int a = i >> h;
			if (lz[a] != 0) {
				put(a << 1, lz[a]); put(a << 1 | 1, lz[a]);
				lz[a] = 0;
			}
		}
	}
	void pull(int i) {
		while (i > 1) {
			i >>= 1;
			if (lz[i] == 0)
				pul(i);
		}
	}
	void update(int l, int r, int d) {
		int l_ = l += n_, r_ = r += n_;
		push(l_); push(r_);
		for ( ; l <= r; l >>= 1, r >>= 1) {
			if ((l & 1) == 1)
				put(l++, d);
			if ((r & 1) == 0)
				put(r--, d);
		}
		pull(l_); pull(r_);
	}
	int query(int l, int r) {
		push(l += n_); push(r += n_);
		int d_ = -1;
		for ( ; l <= r; l >>= 1, r >>= 1) {
			if ((l & 1) == 1) {
				if (d_ < dd[l]) {
					d_ = dd[l]; x_ = xx[l];
				}
				l++;
			}
			if ((r & 1) == 0) {
				if (d_ < dd[r]) {
					d_ = dd[r]; x_ = xx[r];
				}
				r--;
			}
		}
		return d_;
	}
	void main() {
		int n = sc.nextInt();
		int[] ll = new int[n];
		int[] vv = new int[n];
		int[] rr = new int[n];
		for (int i = 0; i < n; i++) {
			ll[i] = sc.nextInt();
			vv[i] = sc.nextInt();
			rr[i] = sc.nextInt();
			x_ = Math.max(x_, rr[i]);
		}
		build(x_ + 1);
		Integer[] ii = new Integer[n * 2];
		for (int h = 0; h < n * 2; h++)
			ii[h] = h;
		Arrays.sort(ii, (i, j) -> {
			int xi = ((i & 1) == 0 ? vv : rr)[i >> 1];
			int xj = ((j & 1) == 0 ? vv : rr)[j >> 1];
			return xi != xj ? xi - xj : (i & 1) - (j & 1);
		});
		int m_ = 0, l = -1, r = -1;
		for (int h = 0; h < n * 2; h++) {
			int i = ii[h] >> 1;
			if ((ii[h] & 1) == 0) {
				int m = query(ll[i], vv[i]) + 1;
				if (m_ < m) {
					m_ = m; l = x_; r = vv[i];
				}
				update(ll[i], vv[i], 1);
			} else
				update(ll[i], vv[i], -1);
		}
		println(m_);
		for (int i = 0; i < n; i++)
			if (ll[i] <= l && l <= vv[i] && vv[i] <= r && rr[i] >= r)
				print(i + 1 + " ");
		println();
	}
}