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.math.BigInteger;
import java.util.*;

import static java.lang.Double.parseDouble;
import static java.lang.Integer.MAX_VALUE;
import static java.lang.Integer.bitCount;
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;

public class Main {
    public static void main(String[] args) throws IOException {
        Solver sv = new Solver();
        sv.solve();
    }
}

class Solver {
    BufferedReader in;
    StringTokenizer tok;

    final int N = 300007;
    int[] li, vi, ri;
    int n;

    public void solve() throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));

        n = nextInt();
        li = new int [n];
        vi = new int [n];
        ri = new int [n];
        Event[] E = new Event[2 * n];
        int[] xs = new int [2 * n];
        for(int i = 0; i < n; ++i) {
            li[i] = nextInt();
            vi[i] = nextInt();
            ri[i] = nextInt();
            E[2 * i] = new Event();
            E[2 * i].ty = 1;
            E[2 * i].l = vi[i];
            E[2 * i].r = ri[i];
            E[2 * i].x = li[i];

            E[2 * i + 1] = new Event();
            E[2 * i + 1].ty = -1;
            E[2 * i + 1].l = vi[i];
            E[2 * i + 1].r = ri[i];
            E[2 * i + 1].x = vi[i] + 1;

            xs[2 * i] = li[i];
            xs[2 * i + 1] = vi[i] + 1;
        }
        Arrays.sort(E);
        Arrays.sort(xs);
        int nx = 1;
        for(int i = 1; i < 2 * n; ++i) {
            if (xs[i] != xs[i - 1]) {
                xs[nx++] = xs[i];
            }
        }
        SegmentTree S = new SegmentTree();
        int j = 0;
        int best = 0, bestX = 0, bestY = 0;
        for(int i = 0; i < nx; ++i) {
            int x = xs[i];
            while(j < 2 * n && E[j].x <= x) {
                S.update(1, 0, N - 1, E[j].l, E[j].r, E[j].ty);
                ++j;
            }
            int cnt = S.T[1] + S.add[1];
            int pos = S.maxPos[1];
            if (cnt > best) {
                best = cnt;
                bestX = x;
                bestY = pos;
            }
        }
        System.out.println(best);
        for(int i = 0; i < n; ++i) {
            if (bestX <= vi[i] && vi[i] <= bestY && li[i] <= bestX && bestY <= ri[i]) {
                System.out.print(i + 1 + " ");
            }
        }
        System.out.println();

    }

    class SegmentTree {
        int[] T = new int [4 * N];
        int[] add = new int [4 * N];
        int[] maxPos = new int [4 * N];

        SegmentTree() {
            build(1, 0, N - 1);
        }

        void build(int v, int tl, int tr) {
            if (tl == tr) {
                T[v] = 0;
                maxPos[v] = tl;
                add[v] = 0;
                return;
            }
            int tm = (tl + tr) / 2;
            build(2 * v, tl, tm);
            build(2 * v + 1, tm + 1, tr);
            T[v] = 0;
            add[v] = 0;
            maxPos[v] = maxPos[2 * v];
        }

        void update(int v, int tl, int tr, int l, int r, int d) {
            if (tl == l && tr == r) {
                add[v] += d;
                return;
            }
            if (add[v] != 0) {
                add[2 * v] += add[v];
                add[2 * v + 1] += add[v];
                T[v] += add[v];
                add[v] = 0;
            }
            int tm = (tl + tr) / 2;
            if (r <= tm) {
                update(2 * v, tl, tm, l, r, d);
            } else if (l > tm) {
                update(2 * v + 1, tm + 1, tr, l, r, d);
            } else {
                update(2 * v, tl, tm, l, tm, d);
                update(2 * v + 1, tm + 1, tr, tm + 1, r, d);
            }
            int left = add[2 * v] + T[2 * v];
            int right = add[2 * v + 1] + T[2 * v + 1];
            T[v] = Math.max(left, right);
            if (left > right) {
                maxPos[v] = maxPos[2 * v];
            } else {
                maxPos[v] = maxPos[2 * v + 1];
            }
        }
    }

    class Event implements Comparable<Event> {
        int l, r, x, ty;

        public int compareTo(Event o) {
            return x - o.x;
        }
    }

    String next() throws IOException {
        if (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int nextInt() throws IOException {
        return parseInt(next());
    }

    long nextLong() throws IOException {
        return parseLong(next());
    }

    double nextDouble() throws IOException {
        return parseDouble(next());
    }
}