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.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;

public class CF_377D 
{


	static class SegmentTree 
	{

		int[] lo,hi,lazy,max;
	

		SegmentTree(int n)
		{
			lo = new int[4 * n + 1];
			hi = new int[4 * n + 1]; 
			lazy = new int[4 * n + 1]; 
			max = new int[4 * n + 1];
			init(1,1,n);
		}

		void init(int i,int a,int b)
		{
			lo[i] = a; hi[i] = b;
			if(a == b)
			{
				max[i] = 0;
				return;
			}
			int mid = (a + b) / 2;
			init(i << 1,a,mid);
			init((i << 1) + 1,mid + 1,b);
		}
		void increment(int a,int b,int val)
		{
			increment(1,a,b,val);
		}
		int maximum(int a,int b)
		{
			return maximum(1,a,b);
		}
		void update(int i)
		{
			max[i] = Math.max(max[i << 1] + lazy[i << 1], max[(i << 1) + 1] + lazy[(i << 1) + 1]);
		}
		void prop(int i)
		{
			lazy[i << 1] += lazy[i];
			lazy[(i << 1) + 1] += lazy[i];
			lazy[i] = 0;
		}


		int maximum(int i,int a,int b)
		{
			// out of cover
			if(b < lo[i] || a > hi[i])
				return -(1 << 30);
			// fully covered
			if(a <= lo[i] && hi[i] <= b)

				return max[i] + lazy[i];

			prop(i);

			int maxLeft = maximum(i << 1,a,b);
			int maxRight = maximum((i << 1) + 1,a,b);

			update(i);
			return Math.max(maxLeft, maxRight);
		}
		void increment(int i,int a,int b,int val)
		{
			// out of cover
			if(b < lo[i] || a > hi[i])
				return;
			// fully covered
			if(a <= lo[i] && hi[i] <= b)
			{
				lazy[i] += val;
				return;
			}
			// partial cover

			// propagate
			prop(i);

			// increment
			increment(i << 1,a,b,val);
			increment((i << 1) + 1,a,b,val);


			update(i);

		}
	}
	static class Person implements Comparable<Person>
	{
		int l,v,r,id;
		public Person(int l,int v,int r,int id)
		{
			this.l = l;
			this.r = r;
			this.v = v;
			this.id = id;
		}
		@Override
		public int compareTo(Person o) 
		{
			return this.r - o.r;
		}

	}

	static Person p[];
	static int n;

	public static void main(String[]args)throws Throwable
	{
		Scanner sc = new Scanner(System.in);

		n = sc.nextInt();
		p = new Person[n];
		for(int i = 0 ; i < n ; ++i)
			p[i] = new Person(sc.nextInt(),sc.nextInt(),sc.nextInt(),i + 1);
		Arrays.sort(p,new Comparator<Person>() {

			public int compare(Person a , Person b) 
			{

				return a.v - b.v;
			}

		});
		PriorityQueue<Person> pq = new PriorityQueue();
		SegmentTree st = new SegmentTree(3*100005);
		int ans = 0;
		int opt = 0;
		for(int i = 0 ; i < n ; ++i)
		{
			Person curr = p[i];
			
			while(!pq.isEmpty() && pq.peek().r < curr.v)
			{
				st.increment(1,pq.peek().l,pq.peek().v,-1);
				pq.poll();
			}
			pq.add(curr);
			st.increment(1,curr.l,curr.v,1);
			int tmp = 0;
			ans = Math.max(ans, tmp = st.maximum(curr.l,curr.v));
			if(ans == tmp)
				opt = i;

		}
		 st = new SegmentTree(3*100005);
		 for(int i = opt ; i >= 0 ; --i)
		 {
			 if(p[i].r >= p[opt].v)
			 {
				 st.increment(p[i].l, p[i].v, 1);
				
			 }
		 }
		 int s = -1;
		 int e = p[opt].v;
		 for(int k = 0 ; k <= e; ++k)
		 {
			
			 if(st.maximum(k,k) == ans)
			 {
				 s = k;
				 break;
			 }
			 
		 }
		 
		// System.out.println(s+" "+e);
		
		PrintWriter out = new PrintWriter(System.out);
	
		out.println(ans);
		
		for(int i = 0 ; ans > 0 && i <= opt ; ++i)
		{
			if(p[i].r >= e && p[i].v >= s && p[i].l <= s)
			{
				out.print(p[i].id+" "); --ans;
				
			}
		}
		out.flush();
		out.close();
		
		
		


	}


	static class Scanner
	{
		BufferedReader br;
		StringTokenizer st;


		Scanner(InputStream s)  { br = new BufferedReader(new InputStreamReader(s)); }
		public Scanner(String s) throws FileNotFoundException{	br = new BufferedReader(new FileReader(s));}


		String next() throws IOException
		{

			while(st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();

		}
		int nextInt() throws NumberFormatException, IOException { return Integer.parseInt(next()); }
		long nextLong() throws NumberFormatException, IOException { return Long.parseLong(next()); }



	}
}