#include <bits/stdc++.h>
using namespace std;
int mycmp(const pair<pair<int, int>, int>& a,
          const pair<pair<int, int>, int>& b) {
  return a.first.first < a.first.first;
}
int main() {
  {
    cin.sync_with_stdio(0);
    cout.sync_with_stdio(0);
    cin.tie(0);
    cout.tie();
  }
  {}
  int n, k;
  cin >> n >> k;
  vector<int> f(300, 0);
  vector<pair<pair<int, int>, int> > a(n);
  for (int i = (int)(0); i < (int)(n); i++) {
    cin >> a[i].first.first >> a[i].first.second;
    a[i].second = i + 1;
    for (int j = (int)(a[i].first.first); j < (int)(a[i].first.second + 1); j++)
      f[j]++;
  }
  sort(a.begin(), a.end());
  vector<int> res(0);
  vector<int> check(n, 0);
  for (int i = 1; i <= 200; i++) {
    while (f[i] > k) {
      int Max = 0, dx = -1;
      for (int j = 0; j < n; j++) {
        if (check[j]) continue;
        if (a[j].first.first <= i && i <= a[j].first.second) {
          if (Max <= a[j].first.second - i) {
            Max = a[j].first.second - i;
            dx = j;
          }
        }
      }
      check[dx] = 1;
      res.push_back(a[dx].second);
      for (int j = (int)(a[dx].first.first); j < (int)(a[dx].first.second + 1);
           j++)
        f[j]--;
    }
  }
  sort(res.begin(), res.end());
  cout << res.size() << "\n";
  for (int i : res) cout << i << " ";
  return 0;
}
