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 Main {
    class node {
        int l, v, r, id;
    }

    void Up(int[] max, int[] maxAt, int fa, int ls, int rs) {
        if (max[ls] > max[rs]) {
            max[fa] = max[ls];
            maxAt[fa] = maxAt[ls];
        } else {
            max[fa] = max[rs];
            maxAt[fa] = maxAt[rs];
        }
    }

    void Down(int[] max, int[] addv, int fa, int ls, int rs) {
        if (addv[fa] != 0) {
            addv[ls] += addv[fa];
            addv[rs] += addv[fa];
            max[ls] += addv[fa];
            max[rs] += addv[fa];
            addv[fa] = 0;
        }
    }

    void build(int[] max, int[] addv, int[] maxAt, int l, int r, int rt) {
        max[rt] = addv[rt] = 0;
        maxAt[rt] = l;
        if (l == r)
            return;
        int mid = (l + r) >> 1;
        build(max, addv, maxAt, l, mid, rt << 1);
        build(max, addv, maxAt, mid + 1, r, rt << 1 | 1);
    }

    void update(int L, int R, int v, int[] max, int[] addv, int[] maxAt, int l,
            int r, int rt) {
        if (L <= l && r <= R) {
            max[rt] += v;
            addv[rt] += v;
            return;
        }
        Down(max, addv, rt, rt << 1, rt << 1 | 1);
        int mid = (l + r) >> 1;
        if (R <= mid)
            update(L, R, v, max, addv, maxAt, l, mid, rt << 1);
        else if (L > mid)
            update(L, R, v, max, addv, maxAt, mid + 1, r, rt << 1 | 1);
        else {
            update(L, mid, v, max, addv, maxAt, l, mid, rt << 1);
            update(mid + 1, R, v, max, addv, maxAt, mid + 1, r, rt << 1 | 1);
        }

        Up(max, maxAt, rt, rt << 1, rt << 1 | 1);
    }

    void run() throws IOException {
        int n = cin.nextInt();
        node[] ar = new node[n];
        int maxr = 0;
        for (int i = 0; i < n; ++i) {
            ar[i] = new node();
            ar[i].l = cin.nextInt();
            ar[i].v = cin.nextInt();
            ar[i].r = cin.nextInt();
            ar[i].id = i + 1;
            maxr = Math.max(maxr, ar[i].r);
        }

        Arrays.sort(ar, new Comparator<node>() {
            public int compare(node i, node j) {
                return i.v - j.v;
            }
        });

        maxr += 3;
        int[] max = new int[maxr * 4+ 10];
        int[] addv = new int[maxr * 4 + 10];
        int[] maxAt = new int[maxr * 4 + 10];
        build(max, addv, maxAt, 1, maxr, 1);

        int best = 0;
        int bestl = 0;
        int bestr = 0;
        int idx = 0;
        Queue<node> Q = new PriorityQueue<node>(ar.length, new Comparator<node>() {
            public int compare(node i, node j) {
                return i.r - j.r;
            }
        });
        for (int i = 1; i <= maxr; ++i) {
            while (idx < ar.length && ar[idx].v == i) {
                update(ar[idx].l, ar[idx].v, 1, max, addv, maxAt, 1, maxr, 1);
                Q.add(ar[idx]);
                ++idx;
            }

            while (0 != Q.size()) {
                node u = Q.peek();
                if (u.r < i) {
                    Q.poll();
                    update(u.l, u.v, -1, max, addv, maxAt, 1, maxr, 1);
                } else
                    break;
            }
            if (max[1] > best) {
                best = max[1];
                bestl = maxAt[1];
                bestr = i;
            }
        }

        out.println(best);
        int f = 0;
        for (node i : ar)
            if (i.l <= bestl && i.r >= bestr && i.v >= bestl && i.v <= bestr) {
                if (f == 0)
                    f = 1;
                else
                    out.print(' ');
                out.print(i.id);
            }
//      out.println();
//      out.println(bestl + " " + bestr);
        out.close();
    }

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    Main() {
        cin = new InputReader(System.in);
        // cin = new Scanner(System.in);
        out = new PrintWriter(System.out);
    }

    PrintWriter out;
    InputReader cin;

    // Scanner cin;

    class InputReader {
        InputReader(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            // try {
            // reader = new BufferedReader(new FileReader("input.txt"));
            // } catch (FileNotFoundException ex) {
            // }
            tokenizer = new StringTokenizer("");
        }

        private String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
            return tokenizer.nextToken();
        }

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

        private BufferedReader reader;
        private StringTokenizer tokenizer;
    }
}