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 
import javax.print.DocFlavor;
import javax.swing.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.IllegalCharsetNameException;
import java.sql.SQLOutput;
import java.util.*;



public class Main {
    static int[][] R;
    static int[] parent; /// DSU



    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        int n = Reader.nextInt();
        int k = Reader.nextInt();
        int[][]q = new int[n][3];
        int[] cnt = new int[1000];
        for (int i = 0 ; i < n ;i++){
            q[i][0] = Reader.nextInt();
            q[i][1] = Reader.nextInt();
            q[i][2] = i+1;
        }
        Arrays.sort(q, new Comparator<int[]>() {
            @Override
            public int compare(int[] o1, int[] o2) {
                return ((o1[1] - o1[0]) - (o2[1] - o2[0]));
            }
        });
        //System.out.println(Arrays.deepToString(q));
        LinkedList<Integer> ans = new LinkedList<>();
        int answer = 0;
        for (int i = 0 ; i < n ; i++){
            int l = q[i][0];
            int r = q[i][1];
            int flag = 0;
            for (int j = l ;j <= r; j++){
                cnt[j]++;
                if (cnt[j]>k){
                    flag = 1;
                }
            }
            if (flag==1){
                answer++;
                ans.addFirst(q[i][2]);
                //System.out.println(q[i][0] + " " + q[i][1]);
                for (int j = l ; j<=r ; j++){
                    cnt[j]--;
                }
            }
        }
        System.out.println(answer);
        while (!ans.isEmpty()){
            System.out.print(ans.removeFirst()+" ");
        }




    }
    static long get(long[] a , long[] b){
        long sum = 0;
        for (int i = 0 ; i < 3 ; i++){
            sum+=(a[i]-b[i])*(a[i]-b[i]);
        }
        return sum;
    }

    static void solve(int k) throws IOException{
        long n = Reader.nextLong();
        long[] arr = new long[64];
        arr[0] = 1;
        for (int i = 1 ; i  < 64 ; i++){
            arr[i] = 3*arr[i-1];
        }




    }





    static long gcd(long a, long b)
    {
        if (a == 0)
            return b;
        return gcd(b % a, a);
    }

    // method to return LCM of two numbers
    static long lcm(long a, long b)
    {
        return (a*b)/gcd(a, b);
    }

    public static void sortbyColumn(int arr[][], int col)
    {
        // Using built-in sort function Arrays.sort
        Arrays.sort(arr, new Comparator<int[]>() {

            @Override
            // Compare values according to columns
            public int compare(final int[] entry1,
                               final int[] entry2) {

                // To sort in descending order revert
                // the '>' Operator
                return entry1[col] - entry2[col];
            }
        });  // End of function call sort().
    }
    static int find(int a){
        if (parent[a]!=a){
            parent[a] = find((int)parent[a]);
        }
        return parent[a];
    }

















}

class TrieNode{

    static int size;
    static TrieNode root = new TrieNode();
    int isEnd;
    int leafs;

    int value;
    TrieNode[] arr = new TrieNode[2];
    public TrieNode(){
        value = 0;
        arr[0] = null;
        arr[1] = null;
    }

    static void insert(int n){
        TrieNode node = root;
        root.leafs++;
        for (int i = size -1;  i>=0 ; i--){
            int val = (n&(1<<i)) >= 1? 1:0;
            if(node.arr[val]==null){
                node.arr[val]=new TrieNode();
            }
            node = node.arr[val];
            node.leafs++;
        }
        node.value = n;
        node.isEnd++;
    }

    static int query(int n , int k){
        TrieNode tmp = root;
        int ans = 0;
        long num = 0;
        for(int i = size-1 ; i>=0 ; i--){
            //System.out.println(i);
            int val = ((n>>i)&1);
            //System.out.println(n + " " +val + " " + num + " " + i);
            if (tmp==null){
                //System.out.println("BREAK");
                break;
            }
            //System.out.println((num | (1<< i)));
            if ((num | (1<< i))>=k){
                if (val==1){
                    if (tmp.arr[0]!=null){
                        ans+=tmp.arr[0].leafs;
                    }
                }
                else{
                    if (tmp.arr[1]!=null){
                        ans+=tmp.arr[1].leafs;
                    }
                }
                tmp = tmp.arr[val];
            }
            else {
                if (val==1){
                    tmp = tmp.arr[0];
                }
                else{
                    tmp = tmp.arr[1];
                }
                num |=(1<<i);
            }
        }
        //System.out.println(num);
        if (num>=k){
            ans+=tmp.leafs;
        }
        //System.out.println();

        return ans;
    }

}

class Edge implements Comparable<Edge>{
    int x , y , w;

    public Edge(int x, int y, int w) {
        this.x = x;
        this.y = y;
        this.w = w;
    }

    @Override
    public int compareTo(Edge o) {
        return this.w - o.w;
    }
}
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}
class MergeSort
{
    // Merges two subarrays of arr[].
    // First subarray is arr[l..m]
    // Second subarray is arr[m+1..r]
    void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int [n1];
        int R[] = new int [n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];


        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
    void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

    /* A utility function to print array of size n */
    static void printArray(int arr[])
    {
        int n = arr.length;
        for (int i=0; i<n; ++i)
            System.out.print(arr[i] + " ");
        System.out.println();
    }

    // Driver method

}

class Node implements Comparable<Node>{
    int a;
    int b;
    Node (int a , int b){
        this.a = a;
        this.b = b;
    }



    public int compareTo(Node o) {
        if (this.a != o.a) {
            return this.a - o.a;
        }
        else{
            return this.b - o.b;
        }
    }
}