#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 205;
const ll mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, k, m[N] = {0};
  pair<int, int> a[N];
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    for (int j = a[i].first; j <= a[i].second; j++) {
      m[j]++;
    }
  }
  vector<int> ans;
  bool used[N] = {0};
  for (int i = 1; i <= N - 5; i++) {
    while (m[i] > k) {
      int mx = -1, in = 0;
      for (int j = 1; j <= n; j++) {
        if (used[j]) continue;
        if (a[j].first <= i && a[j].second >= i && a[j].second - i > mx) {
          mx = a[j].second - i;
          in = j;
        }
      }
      ans.push_back(in);
      used[in] = 1;
      for (int j = a[in].first; j <= a[in].second; j++) {
        m[j]--;
      }
    }
  }
  cout << ans.size() << E;
  for (auto i : ans) {
    cout << i << " ";
  }
  return 0;
}
