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 DOK {

    final int MAX = 350_000;
    
    public void solve() {
        int n = in.nextInt();
        int[] l = new int[n], v = new int[n], r = new int[n];
        for (int i = 0; i < n; i++) {
            l[i] = in.nextInt() - 1;
            v[i] = in.nextInt() - 1;
            r[i] = in.nextInt() - 1;
        }
        
        Segment[] byLeft = new Segment[n], byV = new Segment[n];
        for (int i = 0; i < n; i++) {
            byLeft[i] = new Segment(l[i], r[i], v[i], i);
            byV[i] = new Segment(l[i], r[i], v[i], i);
        }
        Arrays.sort(byLeft, new Comparator<Segment>() {
            @Override
            public int compare(Segment o1, Segment o2) {
                return o1.l - o2.l;
            }
        });
        Arrays.sort(byV, new Comparator<Segment>() {
            @Override
            public int compare(Segment o1, Segment o2) {
                return o1.v - o2.v;
            }
        });
        
        int best = 0;
        int bestL = 0, bestR = 0;
        SegmentTree tree = new SegmentTree(MAX);
        for (int i = 0, j = 0; i < n;) {
            int curL = byLeft[i].l;
            
            while (i < n && byLeft[i].l == curL) {
                tree.add(byLeft[i].v, byLeft[i].r, 1);
                i++;
            }
            while (j < n && byV[j].v < curL) {
                tree.add(byV[j].v, byV[j].r, -1);
                j++;
            }
            
            int max = tree.tree[0];
            int pos = tree.pos[0];
            if (max > best) {
                best = max;
                bestL = curL;
                bestR = pos;
            }
        }
        
        out.println(best);
        for (int i = 0; i < n; i++) {
            if (l[i] <= bestL && bestL <= v[i] && v[i] <= bestR && bestR <= r[i]) {
                out.print((i + 1) + " ");
            }
        }
    }
    
    class Segment {
        int l, r, v, i;

        public Segment(int l, int r, int v, int i) {
            super();
            this.l = l;
            this.r = r;
            this.v = v;
            this.i = i;
        }
    }
    
    class SegmentTree {
        int[] tree, add, pos;
        
        int size;
        public SegmentTree(int n) {
            size = n;
            tree = new int[4 * n];
            add = new int[4 * n];
            pos = new int[4 * n];
            build(0, size, 0);
        }
        
        void build(int left, int right, int i) {
            if (left + 1 == right) {
                pos[i] = left;
                return;
            }
            int mid = (left + right) >> 1;
            build(left, mid, 2 * i + 1);
            build(mid, right, 2 * i + 2);
            pos[i] = left;
        }
        
        void add(int from, int to, int val) {
            add(0, size, from, to + 1, val, 0);
        }
        
        void addValue(int i, int val) {
            tree[i] += val;
            add[i] += val;
        }
        
        void give(int i, int l, int r) {
            if (add[i] != 0) {
                if (l + 1 < r) {
                    addValue(2 * i + 1, add[i]);
                    addValue(2 * i + 2, add[i]);
                }
                add[i] = 0;
            }
        }
        
        void gather(int i) {
            if (tree[2 * i + 1] > tree[2 * i + 2]) {
                pos[i] = pos[2 * i + 1];
                tree[i] = tree[2 * i + 1];
            } else {
                pos[i] = pos[2 * i + 2];
                tree[i] = tree[2 * i + 2];
            }
        }
        
        void add(int left, int right, int l, int r, int val, int i) {
            give(i, left, right);
            if (l <= left && right <= r) {
                addValue(i, val);
                return;
            } else if (right <= l || r <= left) {
                return;
            } else {
                int mid = (left + right) >> 1;
                add(left, mid, l, r, val, 2 * i + 1);
                add(mid, right, l, r, val, 2 * i + 2);
                gather(i);
            }
        }
    }

    FastScanner in;
    PrintWriter out;

    public void run() {
        try {
            in = new FastScanner();
            out = new PrintWriter(System.out);
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastScanner(String name) {
            try {
                br = new BufferedReader(new FileReader(name));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

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