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 
#include <bits/stdc++.h>
using namespace std;
long long M = 1e9 + 7;
long long fact[300000 + 7];
long long sieve[1000000 + 6];
long long power(long long x, long long y) {
  if (y == 0) return 1;
  long long t = power(x, y / 2);
  t = ((t % M) * (t % M)) % M;
  if (y % 2 == 1) t = ((t % M) * (x % M)) % M;
  return t;
}
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a > b) return b;
  return a;
}
bool sortinrev(const pair<long long, long long> &a,
               const pair<long long, long long> &b) {
  return (a.first > b.first);
}
long long isPrime(long long x) {
  vector<long long> v;
  long long i;
  for (i = 1; i * i <= x; i++) {
    if (x % i == 0) {
      if (i * i == x)
        v.push_back(i);
      else {
        v.push_back(i);
        v.push_back(x / i);
      }
    }
  }
  return v.size() == 2;
}
long long binarySearch(vector<long long> arr, long long l, long long r,
                       long long x) {
  if (r >= l) {
    long long mid = l + (r - l) / 2;
    if (arr[mid] == x) return mid;
    if (arr[mid] > x) return binarySearch(arr, l, mid - 1, x);
    return binarySearch(arr, mid + 1, r, x);
  }
  return -1;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long phi(long long n) {
  long long result = n;
  for (long long p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      while (n % p == 0) n /= p;
      result -= result / p;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
void dfs(long long source, long long visited[], vector<long long> graph[],
         long long l) {
  visited[source] = l;
  long long i;
  for (i = 0; i < graph[source].size(); i++) {
    if (visited[graph[source][i]] == -1)
      dfs(graph[source][i], visited, graph, l);
  }
}
long long day(long long d, long long m, long long y) {
  static long long t[] = {0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4};
  y -= m < 3;
  return (y + y / 4 - y / 100 + y / 400 + t[m - 1] + d) % 7;
}
bool isPerfectSquare(long double x) {
  long double sr = sqrt(x);
  return ((sr - floor(sr)) == 0);
}
long long getMid(long long s, long long e) { return s + (e - s) / 2; }
long long getSumUtil(long long *st, long long ss, long long se, long long qs,
                     long long qe, long long si) {
  if (qs <= ss && qe >= se) return st[si];
  if (se < qs || ss > qe) return 0;
  long long mid = getMid(ss, se);
  return getSumUtil(st, ss, mid, qs, qe, 2 * si + 1) +
         getSumUtil(st, mid + 1, se, qs, qe, 2 * si + 2);
}
void updateValueUtil(long long *st, long long ss, long long se, long long i,
                     long long diff, long long si) {
  if (i < ss || i > se) return;
  st[si] = st[si] + diff;
  if (se != ss) {
    long long mid = getMid(ss, se);
    updateValueUtil(st, ss, mid, i, diff, 2 * si + 1);
    updateValueUtil(st, mid + 1, se, i, diff, 2 * si + 2);
  }
}
void updateValue(long long arr[], long long *st, long long n, long long i,
                 long long new_val) {
  if (i < 0 || i > n - 1) {
    cout << "Invalid Input";
    return;
  }
  long long diff = new_val - arr[i];
  arr[i] = new_val;
  updateValueUtil(st, 0, n - 1, i, diff, 0);
}
long long getSum(long long *st, long long n, long long qs, long long qe) {
  if (qs < 0 || qe > n - 1 || qs > qe) {
    cout << "Invalid Input";
    return -1;
  }
  return getSumUtil(st, 0, n - 1, qs, qe, 0);
}
long long constructSTUtil(long long arr[], long long ss, long long se,
                          long long *st, long long si) {
  if (ss == se) {
    st[si] = arr[ss];
    return arr[ss];
  }
  long long mid = getMid(ss, se);
  st[si] = constructSTUtil(arr, ss, mid, st, si * 2 + 1) +
           constructSTUtil(arr, mid + 1, se, st, si * 2 + 2);
  return st[si];
}
long long *constructST(long long arr[], long long n) {
  long long x = (long long)(ceil(log2(n)));
  long long max_size = 2 * (long long)pow(2, x) - 1;
  long long *st = new long long[max_size];
  constructSTUtil(arr, 0, n - 1, st, 0);
  return st;
}
bool comp(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.second < p2.second;
}
vector<long long> maxSubArraySum(long long a[], long long size) {
  long long max_so_far = LONG_MIN, max_ending_here = 0, start = 0, end = 0,
            s = 0;
  for (long long i = 0; i < size; i++) {
    max_ending_here += a[i];
    if (max_so_far < max_ending_here) {
      max_so_far = max_ending_here;
      start = s;
      end = i;
    }
    if (max_ending_here < 0) {
      max_ending_here = 0;
      s = i + 1;
    }
  }
  vector<long long> v;
  v.push_back(max_so_far);
  v.push_back(start);
  v.push_back(end);
  return v;
}
vector<long long> smallestSumSubarr(long long arr[], long long n) {
  long long min_ending_here = 0;
  long long min_so_far = LONG_MAX, start = 0, end = 0, s = 0;
  for (long long i = 0; i < n; i++) {
    min_ending_here += arr[i];
    if (min_so_far > min_ending_here) {
      min_so_far = min_ending_here;
      start = s;
      end = i;
    }
    if (min_ending_here > 0) {
      min_ending_here = 0;
      s = i + 1;
    }
  }
  vector<long long> v;
  v.push_back(min_so_far);
  v.push_back(start);
  v.push_back(end);
  return v;
}
void bfs(vector<long long> g[], long long dist[], bool v[], long long u) {
  queue<long long> q;
  q.push(u);
  v[u] = true;
  dist[u] = 0;
  while (!q.empty()) {
    long long f = q.front();
    q.pop();
    for (auto i = g[f].begin(); i != g[f].end(); i++) {
      if (!v[*i]) {
        q.push(*i);
        v[*i] = true;
        dist[*i] = dist[f] + 1;
      }
    }
  }
}
class DisjSet {
  long long *rank, *parent, *gc, n;

 public:
  DisjSet(long long n) {
    rank = new long long[n];
    parent = new long long[n];
    gc = new long long[n];
    this->n = n;
    makeSet();
  }
  void makeSet() {
    for (long long i = 0; i < n; i++) {
      parent[i] = i;
    }
    for (long long i = 0; i < n; i++) {
      rank[i] = i;
      gc[i] = i;
    }
  }
  void initi(long long a[]) {
    for (long long i = 0; i < n; i++) gc[i] = a[i] % M;
  }
  long long find(long long x) {
    if (parent[x] != x) {
      parent[x] = find(parent[x]);
    }
    return parent[x];
  }
  bool Union(long long x, long long y) {
    long long xset = find(x);
    long long yset = find(y);
    if (xset == yset) return false;
    if (rank[xset] < rank[yset]) {
      parent[xset] = yset;
      gc[yset] = gcd(gc[yset], gc[xset]) % M;
    } else if (rank[xset] > rank[yset]) {
      parent[yset] = xset;
      gc[xset] = gcd(gc[yset], gc[xset]) % M;
    }
  }
  long long get(long long x) { return gc[x] % M; }
};
bool isPali(string s) {
  long long st = 0, ed = s.size() - 1;
  while (st <= ed && s[st] == s[ed]) {
    st++;
    ed--;
  }
  if (st > ed) return true;
  return false;
}
long long findSplitPoint(long long arr[], long long n) {
  long long leftSum = 0;
  for (long long i = 0; i < n; i++) leftSum += arr[i];
  long long rightSum = 0;
  for (long long i = n - 1; i >= 0; i--) {
    rightSum += arr[i];
    leftSum -= arr[i];
    if (rightSum == leftSum) return i;
  }
  return -1;
}
void printTwoParts(long long arr[], long long n) {
  long long splitPoint = findSplitPoint(arr, n);
  if (splitPoint == -1 || splitPoint == n) {
    cout << "NO\n";
    return;
  }
  cout << "YES\n";
}
bool findPartiion(long long arr[], long long n) {
  long long sum = 0;
  long long i, j;
  for (i = 0; i < n; i++) sum += arr[i];
  if (sum % 2 != 0) return false;
  bool part[sum / 2 + 1][n + 1];
  for (i = 0; i <= n; i++) part[0][i] = true;
  for (i = 1; i <= sum / 2; i++) part[i][0] = false;
  for (i = 1; i <= sum / 2; i++) {
    for (j = 1; j <= n; j++) {
      part[i][j] = part[i][j - 1];
      if (i >= arr[j - 1])
        part[i][j] = part[i][j] || part[i - arr[j - 1]][j - 1];
    }
  }
  return part[sum / 2][n];
}
long long computeXOR(const long long n) {
  switch (n & 3) {
    case 0:
      return n;
    case 1:
      return 1;
    case 2:
      return n + 1;
    case 3:
      return 0;
  }
}
long long sp[1000007];
void siev() {
  sp[1] = 1;
  for (long long i = 2; i < 1000008; i++) sp[i] = i;
  for (long long i = 4; i < 1000008; i += 2) sp[i] = 2;
  for (long long i = 3; i * i < 1000008; i++) {
    if (sp[i] == i) {
      for (int j = i * i; j < 1000008; j += i)
        if (sp[j] == j) sp[j] = i;
    }
  }
}
long long a[2][100009];
vector<long long> getFactorization(long long x) {
  vector<long long> ret;
  while (x != 1) {
    ret.push_back(sp[x]);
    x = x / sp[x];
  }
  return ret;
}
long long findlcm(long long arr[], long long n) {
  long long ans = arr[0];
  for (long long i = 1; i < n; i++)
    ans = (((arr[i] * ans)) / (gcd(arr[i], ans)));
  return ans;
}
void bfs(vector<long long> v[], long long n, long long parent[]) {
  long long i;
  long long flg[100000] = {0};
  queue<long long> q;
  q.push(n);
  parent[n] = -1;
  while (!q.empty()) {
    long long u = q.front();
    q.pop();
    flg[u] = 1;
    for (i = 0; i < v[u].size(); i++) {
      long long ve = v[u][i];
      if (flg[ve] == 0) {
        q.push(ve);
        parent[ve] = u;
      }
    }
  }
}
long long spf[1000008];
void sieveMethod() {
  long long i, j;
  spf[1] = 1;
  for (i = 2; i < 1000008; i++) spf[i] = i;
  for (i = 4; i < 1000008; i += 2) spf[i] = 2;
  for (i = 3; i * i <= 1000008; i++)
    if (spf[i] == i)
      for (j = i * i; j < 1000008; j += i)
        if (spf[j] == j) spf[j] = i;
}
vector<long long> getFactor(long long x) {
  vector<long long> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
long long s;
long long poww[1000000 + 9];
long long c[1000000 + 9];
vector<long long> tree[100000 + 9];
long long depth[100000 + 9];
long long parent[100000 + 9][18];
void dfsUtil(vector<long long> v[], long long s, long long vis[],
             long long dis[]) {
  vis[s] = 1;
  long long i;
  for (i = 0; i < v[s].size(); i++) {
    if (vis[v[s][i]] == 0) {
      vis[v[s][i]] = 1;
      dis[v[s][i]] = dis[s] + 1;
      dfsUtil(v, v[s][i], vis, dis);
    }
  }
}
void precomputeSparseMatrix(long long n) {
  for (long long i = 1; i < 18; i++) {
    for (long long node = 1; node <= n; node++) {
      if (parent[node][i - 1] != -1)
        parent[node][i] = parent[parent[node][i - 1]][i - 1];
    }
  }
}
long long lca(long long u, long long v) {
  if (depth[v] < depth[u]) swap(u, v);
  long long diff = depth[v] - depth[u];
  for (int i = 0; i < 18; i++)
    if ((diff >> i) & 1) v = parent[v][i];
  if (u == v) return u;
  for (long long i = 18 - 1; i >= 0; i--)
    if (parent[u][i] != parent[v][i]) {
      u = parent[u][i];
      v = parent[v][i];
    }
  return parent[u][0];
}
void dfs(vector<long long> v[], long long s, long long dis[], long long vis[],
         long long a[], long long su[], long long y) {
  if (su[s] == -1) {
    a[s] = 0;
  } else {
    a[s] = su[s] - y;
  }
  y += a[s];
  long long i;
  vis[s] = 1;
  for (i = 0; i < v[s].size(); i++) {
    if (vis[v[s][i]] == 0) {
      dis[v[s][i]] = dis[s] + 1;
      dfs(v, v[s][i], dis, vis, a, su, y);
    }
  }
  y -= a[s];
}
void numberOfNodes(vector<long long> adj[], long long count1[], long long s,
                   long long e) {
  vector<long long>::iterator u;
  count1[s] = 1;
  for (u = adj[s].begin(); u != adj[s].end(); u++) {
    if (*u == e) continue;
    numberOfNodes(adj, count1, *u, s);
    count1[s] += count1[*u];
  }
}
void findClosest(long long A[], long long B[], long long C[], long long p,
                 long long q, long long r) {
  long long diff = LONG_MAX;
  long long res_i = 0, res_j = 0, res_k = 0;
  long long i = 0, j = 0, k = 0;
  while (i < p && j < q && k < r) {
    long long minimum = min(A[i], min(B[j], C[k]));
    long long maximum = max(A[i], max(B[j], C[k]));
    if (maximum - minimum < diff) {
      res_i = i, res_j = j, res_k = k;
      diff = maximum - minimum;
    }
    if (diff == 0) break;
    if (A[i] == minimum)
      i++;
    else if (B[j] == minimum)
      j++;
    else
      k++;
  }
  long long x, y, z;
  x = A[res_i];
  y = B[res_j];
  z = C[res_k];
  cout << (x - y) * (x - y) + (y - z) * (y - z) + (z - x) * (z - x) << endl;
}
long long getClosest(long long, long long, long long);
long long findClosest(vector<long long> arr, long long n, long long target) {
  if (target <= arr[0]) return arr[0];
  if (target >= arr[n - 1]) return arr[n - 1];
  long long i = 0, j = n, mid = 0;
  while (i < j) {
    mid = (i + j) / 2;
    if (arr[mid] == target) return arr[mid];
    if (target < arr[mid]) {
      if (mid > 0 && target > arr[mid - 1])
        return getClosest(arr[mid - 1], arr[mid], target);
      j = mid;
    } else {
      if (mid < n - 1 && target < arr[mid + 1])
        return getClosest(arr[mid], arr[mid + 1], target);
      i = mid + 1;
    }
  }
  return arr[mid];
}
long long getClosest(long long val1, long long val2, long long target) {
  if (target - val1 >= val2 - target)
    return val2;
  else
    return val1;
}
bool com(pair<long long, long long> p1, pair<long long, long long> p2) {
  return p1.second > p2.second;
}
void output() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n, k;
  cin >> n >> k;
  pair<long long, long long> p[n];
  long long i;
  for (i = 0; i < n; i++) cin >> p[i].first >> p[i].second;
  long long j;
  map<pair<long long, long long>, long long> m;
  long long c = 0;
  for (i = 1; i <= 200; i++) {
    vector<pair<long long, long long> > v;
    for (j = 0; j < n; j++) {
      if (p[j].first <= i && p[j].second >= i && m[p[j]] == 0)
        v.push_back(p[j]);
    }
    if (v.size() > k) {
      sort(v.begin(), v.end(), com);
      for (j = 0; j < v.size() - k; j++) {
        m[v[j]]++;
        c++;
      }
    }
  }
  for (i = 1; i <= 200; i++) {
    vector<pair<long long, long long> > v;
    for (j = 0; j < n; j++) {
      if (p[j].first <= i && p[j].second >= i && m[p[j]] == 0)
        v.push_back(p[j]);
    }
    if (v.size() > k) {
      sort(v.begin(), v.end(), com);
      for (j = 0; j < v.size() - k; j++) {
        m[v[j]]++;
        c++;
      }
    }
  }
  cout << c << endl;
  for (i = 0; i < n; i++) {
    if (m[p[i]] != 0) {
      cout << i + 1 << " ";
      m[p[i]]--;
    }
  }
  cout << endl;
}
int main(int argc, const char *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) output();
  return 0;
}
