#include <bits/stdc++.h>
using namespace std;
bool chk(pair<long long, pair<long long, long long>> &a,
         pair<long long, pair<long long, long long>> &b) {
  return a.second.first < b.second.first;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0);
  ;
  long long n, k;
  cin >> n >> k;
  pair<long long, pair<long long, long long>> a[n];
  for (long long i = 0; i < n; i++)
    cin >> a[i].first >> a[i].second.first, a[i].second.second = i + 1;
  sort(a, a + n, chk);
  long long p[205] = {0};
  vector<long long> ans;
  for (long long i = 0; i < n; i++) {
    bool t = 0;
    for (long long j = a[i].first; j <= a[i].second.first; j++) {
      p[j]++;
      if (p[j] > k) t = 1;
    }
    if (t) {
      ans.emplace_back(a[i].second.second);
      for (long long j = a[i].first; j <= a[i].second.first; j++) {
        p[j]--;
      }
    }
  }
  cout << ans.size() << "\n";
  for (auto a : ans) cout << a << " ";
}
