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 N = 200003;
struct node1 {
  int l, r;
  int mx;
} A[N * 4];
struct node2 {
  int l, r;
  int mxk;
  int addtag;
} B[N * 4];
int n, k;
struct Qnode {
  int r, i;
};
bool operator<(Qnode x1, Qnode x2) { return x1.r < x2.r; }
priority_queue<Qnode> heap[N];
void build1(int root, int l, int r) {
  A[root].l = l;
  A[root].r = r;
  A[root].mx = 0;
  if (l == r) {
    return;
  }
  build1(root * 2, l, (l + r) / 2);
  build1(root * 2 + 1, (l + r) / 2 + 1, r);
}
void build2(int root, int l, int r) {
  B[root].l = l;
  B[root].r = r;
  B[root].mxk = 0;
  B[root].addtag = 0;
  if (l == r) {
    return;
  }
  build2(root * 2, l, (l + r) / 2);
  build2(root * 2 + 1, (l + r) / 2 + 1, r);
}
void insert1(int root, int index, int v, int i) {
  if (A[root].l > index || A[root].r < index) {
    return;
  }
  A[root].mx = A[root].mx > v ? A[root].mx : v;
  if (A[root].l == A[root].r) {
    heap[index].push({v, i});
    return;
  }
  insert1(root * 2, index, v, i);
  insert1(root * 2 + 1, index, v, i);
}
void pushdown(int root) {
  if (B[root].addtag) {
    B[root * 2].mxk += B[root].addtag;
    B[root * 2 + 1].mxk += B[root].addtag;
    B[root * 2].addtag += B[root].addtag;
    B[root * 2 + 1].addtag += B[root].addtag;
    B[root].addtag = 0;
  }
}
void update2(int root, int l, int r, int v) {
  if (B[root].l > r || B[root].r < l) {
    return;
  }
  if (B[root].l >= l && B[root].r <= r) {
    B[root].mxk += v;
    B[root].addtag += v;
    return;
  }
  pushdown(root);
  update2(root * 2, l, r, v);
  update2(root * 2 + 1, l, r, v);
  B[root].mxk = B[root * 2].mxk > B[root * 2 + 1].mxk ? B[root * 2].mxk
                                                      : B[root * 2 + 1].mxk;
}
int query2(int root) {
  pushdown(root);
  if (B[root].mxk < k) {
    return -1;
  }
  if (B[root].l == B[root].r) {
    return B[root].l;
  }
  if (B[root * 2].mxk >= k) {
    int x = query2(root * 2);
    return x;
  } else {
    int x = query2(root * 2 + 1);
    return x;
  }
}
struct query1node {
  int l, r, i;
};
query1node query1(int root, int l, int r) {
  if (A[root].mx == 0) {
    return {-1, -1, -1};
  }
  if (A[root].r < l || A[root].l > r) {
    return {-1, -1, -1};
  }
  if (A[root].l == A[root].r) {
    if (!heap[A[root].l].empty()) {
      return {A[root].l, heap[A[root].l].top().r, heap[A[root].l].top().i};
    } else {
      return {-1, -1, -1};
    }
  }
  if (A[root].l >= l && A[root].r <= r) {
    if (A[root * 2].mx >= A[root * 2 + 1].mx) {
      return query1(root * 2, l, r);
    } else {
      return query1(root * 2 + 1, l, r);
    }
  }
  query1node x1 = query1(root * 2, l, r);
  query1node x2 = query1(root * 2 + 1, l, r);
  if (x1.r >= x2.r) {
    return x1;
  } else {
    return x2;
  }
}
void update1(int root, int index) {
  if (A[root].r < index || A[root].l > index) {
    return;
  }
  if (A[root].l == A[root].r && A[root].l == index) {
    if (!heap[index].empty()) {
      heap[index].pop();
      if (heap[index].empty()) {
        A[root].mx = 0;
      } else {
        A[root].mx = heap[index].top().r;
      }
    } else {
      A[root].mx = 0;
    }
    return;
  }
  update1(root * 2, index);
  update1(root * 2 + 1, index);
  A[root].mx =
      A[root * 2].mx > A[root * 2 + 1].mx ? A[root * 2].mx : A[root * 2 + 1].mx;
}
int main() {
  scanf("%d%d", &n, &k);
  k++;
  build1(1, 1, 200000);
  build2(1, 1, 200000);
  for (int i = 1, l, r; i <= n; i++) {
    scanf("%d%d", &l, &r);
    insert1(1, l, r, i);
    update2(1, l, r, 1);
  }
  int q = query2(1);
  vector<int> ans;
  while (q != -1) {
    query1node x = query1(1, 1, q);
    ans.push_back(x.i);
    update1(1, x.l);
    update2(1, x.l, x.r, -1);
    q = query2(1);
  }
  int len = ans.size();
  printf("%d\n", len);
  for (int i = 0; i < len; i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}