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 long long maxn = 2e5 + 10;
long long N, K, seg[maxn << 2], lazy[maxn << 2];
struct Node {
  long long l, r, id;
  friend bool operator<(const Node& a, const Node& b) { return a.r < b.r; }
  friend bool operator>(const Node& a, const Node& b) { return a.r > b.r; }
};
inline long long cmp(const Node& a, const Node& b) { return a.l < b.l; }
inline void pushdown(long long cur) {
  if (lazy[cur]) {
    seg[(cur << 1)] += lazy[cur];
    seg[(cur << 1 | 1)] += lazy[cur];
    lazy[(cur << 1)] += lazy[cur];
    lazy[(cur << 1 | 1)] += lazy[cur];
    lazy[cur] = 0;
  }
}
inline void pushup(long long cur) {
  seg[cur] = max(seg[(cur << 1)], seg[(cur << 1 | 1)]);
}
inline void update(long long l, long long r, long long L, long long R,
                   long long cur, long long val) {
  if (l >= L && r <= R) {
    seg[cur] += val;
    lazy[cur] += val;
    return;
  }
  pushdown(cur);
  if (((l + r) >> 1) >= L) {
    update(l, ((l + r) >> 1), L, R, (cur << 1), val);
  }
  if (((l + r) >> 1) < R) {
    update(((l + r) >> 1) + 1, r, L, R, (cur << 1 | 1), val);
  }
  pushup(cur);
}
inline long long query(long long l, long long r, long long L, long long R,
                       long long cur) {
  if (l >= L && r <= R) {
    return seg[cur];
  }
  pushdown(cur);
  long long ans = 0;
  if (((l + r) >> 1) >= L) {
    ans = query(l, ((l + r) >> 1), L, R, (cur << 1));
  }
  if (((l + r) >> 1) < R) {
    ans = max(ans, query(((l + r) >> 1) + 1, r, L, R, (cur << 1 | 1)));
  }
  return ans;
}
vector<Node> v;
vector<long long> res;
const long long RR = 2e5;
signed main() {
  ios::sync_with_stdio(false);
  cin >> N >> K;
  for (register long long i = 1; i <= N; ++i) {
    Node nN;
    cin >> nN.l >> nN.r;
    nN.id = i;
    v.push_back(nN);
  }
  priority_queue<Node> q;
  sort(v.begin(), v.end(), cmp);
  long long sz = v.size(), cnt = 0;
  for (register long long i = 0; i < sz; ++i) {
    update(1, RR, v[i].l, v[i].r, 1, 1);
    long long mx = seg[1];
    if (mx > K) {
      Node top = q.top();
      if (top.r > v[i].r) {
        q.pop();
        q.push(v[i]);
        res.push_back(top.id);
      } else {
        top = v[i];
        res.push_back(top.id);
      }
      update(1, RR, top.l, top.r, 1, -1);
      ++cnt;
    } else {
      q.push(v[i]);
    }
  }
  cout << cnt << endl;
  for (auto&& i : res) {
    cout << i << " ";
  }
  return 0;
}