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

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskD solver = new TaskD();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskD {
    static class Employee {
        int l;
        int v;
        int r;
        int index;
    }

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int n = in.nextInt();
        Employee[] emps = new Employee[n];
        int maxr = 0;
        for (int i = 0; i < n; ++i) {
            emps[i] = new Employee();
            emps[i].index = i + 1;
            emps[i].l = in.nextInt();
            emps[i].v = in.nextInt();
            emps[i].r = in.nextInt();
            maxr = Math.max(maxr, emps[i].r);
        }
        Arrays.sort(emps, new Comparator<Employee>() {
            @Override
            public int compare(Employee o1, Employee o2) {
                return o1.l - o2.l;
            }
        });
        maxr += 3;
        int[] max = new int[4 * maxr + 10];
        int[] sum = new int[4 * maxr + 10];
        int[] maxAt = new int[4 * maxr + 10];
        int best = 0;
        int bestl = 0;
        int bestr = 0;
        Employee[] empByV = emps.clone();
        Arrays.sort(empByV, new Comparator<Employee>() {
            @Override
            public int compare(Employee o1, Employee o2) {
                return o1.v - o2.v;
            }
        });
        int ptrV = 0;
        initTree(max, sum, maxAt, 0, 0, maxr - 1);
        for (Employee emp : emps) {
            while (ptrV < empByV.length && empByV[ptrV].v < emp.l) {
                update(max, sum, maxAt, 0, 0, maxr - 1, empByV[ptrV].v, -1);
                update(max, sum, maxAt, 0, 0, maxr - 1, empByV[ptrV].r + 1, 1);
                ++ptrV;
            }
            update(max, sum, maxAt, 0, 0, maxr - 1, emp.v, 1);
            update(max, sum, maxAt, 0, 0, maxr - 1, emp.r + 1, -1);
            if (max[0] > best) {
                best = max[0];
                bestl = emp.l;
                bestr = maxAt[0];
            }
        }
        out.println(best);
        boolean first = true;
        for (Employee emp : emps) {
            if (bestl <= emp.v && bestr >= emp.v && bestl >= emp.l && bestr <= emp.r) {
                if (first) first = false; else out.print(" ");
                out.print(emp.index);
            }
        }
        out.println();
    }

    private void initTree(int[] max, int[] sum, int[] maxAt, int root, int rl, int rr) {
        if (rl == rr) {
            maxAt[root] = rl;
            return;
        }
        int rm = (rl + rr) / 2;
        initTree(max, sum, maxAt, root * 2 + 1, rl, rm);
        initTree(max, sum, maxAt, root * 2 + 2, rm + 1, rr);
    }

    private void update(int[] max, int[] sum, int[] maxAt, int root, int rl, int rr, int at, int by) {
        if (rl == rr) {
            max[root] += by;
            sum[root] += by;
            return;
        }
        int rm = (rl + rr) / 2;
        if (at <= rm) {
            update(max, sum, maxAt, root * 2 + 1, rl, rm, at, by);
        } else {
            update(max, sum, maxAt, root * 2 + 2, rm + 1, rr, at, by);
        }
        sum[root] = sum[root * 2 + 1] + sum[root * 2 + 2];
        int maxr = sum[root * 2 + 1] + max[root * 2 + 2];
        if (maxr <= max[root * 2 + 1]) {
            max[root] = max[root * 2 + 1];
            maxAt[root] = maxAt[root * 2 + 1];
        } else {
            max[root] = maxr;
            maxAt[root] = maxAt[root * 2 + 2];
        }
    }
}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    }