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.*;
import java.lang.reflect.Array;
import java.util.*;

import static java.lang.Math.max;
import static java.lang.Math.min;

public class Main {


    void run() throws IOException {
        int n = nextInt();
        int k = nextInt();
        int[][] a = new int[n][2];
        TreeSet<Event> ts = new TreeSet<>(new EventComp());
        for (int i = 0; i < n; i++) {
            a[i][0] = nextInt();
            a[i][1] = nextInt();
            ts.add(new Event(a[i][0], 0, i));
            ts.add(new Event(a[i][1], 1, i));
        }
        int count = 0;
        Stack<Integer> ans = new Stack<>();
        TreeMap<Integer, TreeSet<Integer>> max_last = new TreeMap<>();
        TreeSet<Integer> del = new TreeSet<>();
        for (Event e : ts) {
            if (del.contains(e.num)) continue;
            if (e.type == 0) {
                count++;
                if (!max_last.containsKey(a[e.num][1])) {
                    max_last.put(a[e.num][1], new TreeSet<>());
                }
                max_last.get(a[e.num][1]).add(e.num);
                if (count > k) {
                    int t = max_last.lastKey();
                    ans.add(max_last.get(t).first());
                    del.add(ans.peek());
                    max_last.get(t).remove(max_last.get(t).first());
                    if (max_last.get(t).size() == 0) max_last.remove(t);
                    count--;
                }
            } else {
                max_last.get(e.pos).remove(e.num);
                if (max_last.get(e.pos).size() == 0) max_last.remove(e.pos);
                count--;
            }
        }
        pw.println(ans.size());
        while (!ans.isEmpty()) {
            pw.print((ans.pop() + 1) + " ");
        }
        pw.close();
    }

    class Event {
        int pos, type, num;

        public Event(int a, int b, int c) {
            pos = a;
            type = b;
            num = c;
        }
    }

    class EventComp implements Comparator<Event> {

        @Override
        public int compare(Event o1, Event o2) {
            if (o1.pos == o2.pos && o1.type == o2.type) return Integer.compare(o1.num, o2.num);
            if (o1.pos == o2.pos) return Integer.compare(o1.type, o2.type);
            return Integer.compare(o1.pos, o2.pos);
        }
    }

    long mod = (long) 1e9 + 7;
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    //BufferedReader br = new BufferedReader(new FileReader("qual.in"));

    StringTokenizer st = new StringTokenizer("");
    PrintWriter pw = new PrintWriter(System.out);
    //PrintWriter pw = new PrintWriter("qual.out");

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

    String next() throws IOException {
        if (!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

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

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

    public Main() throws FileNotFoundException {
    }

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