#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<pair<long long, long long> > v(n);
  vector<long long> a(201, 0);
  set<long long> ans;
  for (long long i = 0; i < n; i++) {
    cin >> v[i].first >> v[i].second;
    for (long long j = v[i].first; j <= v[i].second; j++) {
      a[j]++;
    }
  }
  while (1) {
    long long flag = 0, m = -1e9, x = 0;
    for (long long i = 0; i < a.size(); i++) {
      if (a[i] > k) {
        flag = i;
        break;
      }
    }
    if (flag) {
      for (long long i = 0; i < n; i++) {
        if (v[i].first <= flag && v[i].second >= flag) {
          if (ans.find(i) == ans.end()) {
            if (m < v[i].second) {
              m = max(m, v[i].second);
              x = i;
            }
          }
        }
      }
      ans.insert(x);
      for (long long j = v[x].first; j <= v[x].second; j++) {
        a[j]--;
      }
    }
    if (!flag) {
      break;
    }
  }
  cout << ans.size() << "\n";
  for (auto i : ans) {
    cout << i + 1 << ' ';
  }
  return 0;
}
