#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, k, seg[202] = {0};
  cin >> n >> k;
  pair<long long int, long long int> a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    seg[a[i].first]++;
    seg[a[i].second + 1]--;
  }
  vector<long long int> v;
  for (long long int i = 2; i <= 200; i++) {
    seg[i] += seg[i - 1];
  }
  set<long long int> vis;
  for (long long int i = 1; i <= 200; i++) {
    while (seg[i] > k) {
      long long int idx = -1;
      for (long long int j = 0; j < n; j++) {
        if (vis.count(j)) continue;
        if (idx == -1 && a[j].first <= i)
          idx = j;
        else if (a[j].second - i > a[idx].second - i && a[j].first <= i)
          idx = j;
      }
      for (long long int j = a[idx].first; j <= a[idx].second; j++) {
        seg[j]--;
      }
      v.push_back(idx + 1);
      vis.insert(idx);
    }
  }
  cout << v.size() << endl;
  for (long long int i : v) cout << i << " ";
  cout << endl;
  return 0;
}
