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:
import java.io.*;
import java.util.*;

public class DevelopingGame {
	static Scanner input = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
	static class SegmentTree {
		int N = 0;
		int[][] count;
		int[][] value;
		int[][] inc;
		
		public SegmentTree(int maxValue) {
			while(maxValue >= 1<<N)
				N++;
			// System.err.println("Max value = " + maxValue + " N = " + N);
			count = createArray();
			inc = createArray();
			value = createArray();
			for(int i=0;i<=N;i++) {
				for(int j=0;j<1<<i;j++) {
					value[i][j] = j<<(N-i);
				}
			}
		}
		private int[][] createArray() {
			int[][] arr = new int[N+1][];
			for(int i=0;i<=N;i++)
				arr[i] = new int[1<<i];
			return arr;
		}
		public void add(int min, int max) { changeSeg(0, 0, min, max, 1); }
		public void remove(int min, int max) { changeSeg(0, 0, min, max, -1); }
		
		public void changeSeg(int depth, int prefix, int min, int max, int change) {
// 			System.err.println("Changing... " + depth + "," + prefix + "," + min
// 					+ "," + max + "," + change);
			int depthMin = prefix << (N - depth);
			int depthMax = depthMin +  (1<< (N - depth)) - 1;
// 			System.err.println(depthMin + " to " + depthMax);
			if(min > depthMax || max < depthMin) {
// 				System.err.println("Ignoring... " + depth + "," + prefix + "," + min
// 						+ "," + max + "," + change);
				return;
			}
			if (min <= depthMin && max >= depthMax) {
				inc[depth][prefix] += change;
				count[depth][prefix] += change;
// 				System.err.println("Adding to segment... " + depth + "," + prefix + "," + min
// 						+ "," + max + "," + change);
			} else {
				int left = prefix << 1, right = left | 1;
				changeSeg(depth+1, left, min, max, change);
				changeSeg(depth+1, right, min, max, change);
				
				int chosen = count[depth+1][left] >=  count[depth+1][right] ?
						left : right;
				value[depth][prefix] = value[depth+1][chosen];
				count[depth][prefix] = count[depth+1][chosen] + inc[depth][prefix];
			}
		}
	}
	
	static class Worker {
		int left, value, right, index;
		public Worker(int index) {
			left = input.nextInt();
			value = input.nextInt();
			right = input.nextInt();
			this.index = index;
		}
	}
	
	public static void main(String[] args) {
		int n = input.nextInt(), maxValue = 0;
		Worker[] workers = new Worker[n];
		for(int i=0;i<n;i++) {
			workers[i] = new Worker(i+1);
			maxValue = Math.max(maxValue, workers[i].right);
		}
		
		Worker[] workersByLeft = new Worker[n];
		System.arraycopy(workers, 0, workersByLeft, 0, n);
		
		Arrays.sort(workers, new Comparator<Worker>() {
			public int compare(Worker a, Worker b) { return a.value - b.value; }
		});
		Arrays.sort(workersByLeft, new Comparator<Worker>() {
			public int compare(Worker a, Worker b) { return a.left - b.left; }
		});
		
		SegmentTree tree = new SegmentTree(maxValue);
		int workerIndex = 0, leftIndex = 0;
		int best = 0, bestLeft = -1, bestRight = -1;
		while(leftIndex < n) {
			int left = workersByLeft[leftIndex].left;
			while(workerIndex < n && workers[workerIndex].value < left) {
				tree.remove(workers[workerIndex].value, workers[workerIndex].right);
				workerIndex++;
			}
			while(leftIndex < n && workersByLeft[leftIndex].left == left) {
				tree.add(workersByLeft[leftIndex].value, workersByLeft[leftIndex].right);
				leftIndex++;
			}
			if (tree.count[0][0] > best) {
				best = tree.count[0][0];
				bestLeft = left;
				bestRight = tree.value[0][0];
			}
		}
		PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		out.println(best);
		for(int i=0,j=0;i<n;i++)
			if(workers[i].left <= bestLeft && workers[i].right >= bestRight &&
				workers[i].value >= bestLeft && workers[i].value <= bestRight)
				out.print(workers[i].index + ((++j==best) ? "\n" : " "));
		out.close();
	}
}