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 CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1e6 + 10;
int sum[Maxn << 2], tag[Maxn << 2];
struct Point {
  int l, r;
  int idx;
} point[Maxn];
struct Node {
  int l, r;
  int mid() { return (l + r) >> 1; }
} node[Maxn << 2];
void buildtree(int l, int r, int rt) {
  node[rt].l = l;
  node[rt].r = r;
  sum[rt] = 0;
  tag[rt] = 0;
  if (l == r) {
    return;
  }
  int mi = node[rt].mid();
  buildtree(l, mi, rt << 1);
  buildtree(mi + 1, r, rt << 1 | 1);
}
void pushdown(int rt) {
  if (tag[rt]) {
    tag[rt << 1] += tag[rt];
    tag[rt << 1 | 1] += tag[rt];
    sum[rt << 1] += tag[rt];
    sum[rt << 1 | 1] += tag[rt];
    tag[rt] = 0;
  }
}
void pushup(int rt) { sum[rt] = max(sum[rt << 1], sum[rt << 1 | 1]); }
void updata(int l, int r, int rt) {
  if (node[rt].l == l && node[rt].r == r) {
    sum[rt] += 1;
    tag[rt] += 1;
    return;
  }
  pushdown(rt);
  int mi = node[rt].mid();
  if (r <= mi)
    updata(l, r, rt << 1);
  else if (l > mi)
    updata(l, r, rt << 1 | 1);
  else {
    updata(l, mi, rt << 1);
    updata(mi + 1, r, rt << 1 | 1);
  }
  pushup(rt);
}
int query(int l, int r, int rt) {
  if (node[rt].l == l && node[rt].r == r) {
    return sum[rt];
  }
  pushdown(rt);
  int mi = node[rt].mid();
  int ans = 0;
  if (r <= mi)
    ans = max(ans, query(l, r, rt << 1));
  else if (l > mi)
    ans = max(ans, query(l, r, rt << 1 | 1));
  else {
    ans = max(ans, query(l, mi, rt << 1));
    ans = max(ans, query(mi + 1, r, rt << 1 | 1));
  }
  return ans;
}
int ans1[Maxn];
bool cmp(Point a, Point b) { return a.r < b.r || a.r == b.r && a.l < b.l; }
int main() {
  int n, m;
  while (~scanf("%d%d", &n, &m)) {
    int mil = 0x3f3f3f3f, mar = -1;
    for (int i = 0; i < n; i++) {
      scanf("%d%d", &point[i].l, &point[i].r);
      mil = min(mil, point[i].l);
      mar = max(mar, point[i].r);
      point[i].idx = i + 1;
    }
    sort(point, point + n, cmp);
    buildtree(1, 200010, 1);
    int total = 0;
    for (int i = 0; i < n; i++) {
      if (query(point[i].l, point[i].r, 1) < m) {
        updata(point[i].l, point[i].r, 1);
      } else
        ans1[total++] = point[i].idx;
    }
    printf("%d\n", total);
    for (int i = 0; i < total; i++) {
      if (i == total - 1)
        printf("%d\n", ans1[i]);
      else
        printf("%d ", ans1[i]);
    }
  }
  return 0;
}