Problem: The only difference between easy and hard versions is constraints.

You are given n segments on the coordinate axis OX. Segments can intersect, lie inside each other and even coincide. The i-th segment is [l_i; r_i] (l_i ≤ r_i) and it covers all integer points j such that l_i ≤ j ≤ r_i.

The integer point is called bad if it is covered by strictly more than k segments.

Your task is to remove the minimum number of segments so that there are no bad points at all.

Input

The first line of the input contains two integers n and k (1 ≤ k ≤ n ≤ 200) — the number of segments and the maximum number of segments by which each integer point can be covered.

The next n lines contain segments. The i-th line contains two integers l_i and r_i (1 ≤ l_i ≤ r_i ≤ 200) — the endpoints of the i-th segment.

Output

In the first line print one integer m (0 ≤ m ≤ n) — the minimum number of segments you need to remove so that there are no bad points.

In the second line print m distinct integers p_1, p_2, ..., p_m (1 ≤ p_i ≤ n) — indices of segments you remove in any order. If there are multiple answers, you can print any of them.

Examples

Input


7 2
11 11
9 11
7 8
8 9
7 8
9 11
7 9


Output


3
1 4 7 


Input


5 1
29 30
30 30
29 29
28 30
30 30


Output


3
1 2 4 


Input


6 1
2 3
3 3
2 3
2 2
2 3
2 3


Output


4
1 3 5 6 

Solution (in JAVA):

Solution:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class TooManySegments {
    int[] tree;
    int size;

    public void add(int from, int to, int toAdd, int a, int b, int node) {
        //System.out.println(node + " " + a + " " + b + " " + from + " " + to);
        if (from <= a && b <= to) {
            this.tree[node] += toAdd;
            return;
        }

        int mid = (a + b) / 2;
        if (from <= mid) {
            add(from, to,toAdd, a, mid, node * 2);
        }
        if (mid < to) {
            add(from, to,toAdd, mid + 1, b, node * 2 + 1);
        }
    }

    public int get(int index, int a, int b, int node) {
        if (a == b) {
            return tree[node];
        }

        int mid = (a + b) / 2;
        if (index <= mid) {
            int toReturn = tree[node] + get(index, a, mid, node * 2);
            return toReturn;
        }
        int toReturn = tree[node] + get(index, mid + 1, b, node * 2 + 1);
        return toReturn;
    }

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

    public void solve() throws IOException{
        BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer tokenizer = new StringTokenizer(f.readLine());
        int n = Integer.parseInt(tokenizer.nextToken());
        int k = Integer.parseInt(tokenizer.nextToken());
        size = 200000;
        tree = new int[4 * size + 5];
        PriorityQueue<int[]> segmentsLeft = new PriorityQueue<int[]>(new ArrayComparator(0, true));
        PriorityQueue<int[]> segmentsRight = new PriorityQueue<int[]>(new ArrayComparator(1, false));
        for (int i = 0; i < n; i++) {
            tokenizer = new StringTokenizer(f.readLine());
            int a = Integer.parseInt(tokenizer.nextToken()) - 1;
            int b = Integer.parseInt(tokenizer.nextToken()) - 1;
            int[] ar = {a, b, i + 1};
            add(a, b, 1,0, size - 1, 1);
            segmentsLeft.add(ar);
        }

        int current = 0;
        ArrayDeque<Integer> result = new ArrayDeque<Integer>();
        while (current < size) {
            while (!segmentsLeft.isEmpty() && segmentsLeft.peek()[0] == current) {
               // System.out.println("oj " + segmentsLeft.size());
                segmentsRight.add(segmentsLeft.poll());
            }

            int turns = get(current, 0, size - 1, 1) - k;
            for (int i = 0; i < turns; i++) {
                int[] segment = segmentsRight.poll();
                add(segment[0], segment[1], -1, 0, size - 1, 1);
                result.addLast(segment[2]);
            }

            current++;
        }

        PrintWriter out = new PrintWriter(System.out);
        out.println(result.size());
        if (result.size() != 0) {
            out.print(result.removeFirst());
            while (!result.isEmpty()) {
                out.print(" ");
                out.print(result.removeFirst());
            }
        }

        out.close();
    }

    private static class ArrayComparator implements Comparator<int[]> {
        int index;
        boolean smallerFirst;

        public ArrayComparator(int index, boolean smallerFirst) {
            this.index = index;
            this.smallerFirst = smallerFirst;
        }

        @Override
        public int compare(int[] ar1, int[] ar2) {
            if (!((ar1[index] < ar2[index]) ^ smallerFirst)) {
                return -1;
            } else if (!((ar1[index] > ar2[index]) ^ smallerFirst)) {
                return 1;
            }

            return 0;
        }
    }

}