#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
struct my_compare {
  bool operator()(pair<int, pair<int, int> > &lhs,
                  pair<int, pair<int, int> > &rhs) const {
    return lhs.second < rhs.second;
  }
};
int main() {
  long long int t, n, k;
  t = 1;
  while (t--) {
    cin >> n >> k;
    vector<pair<int, pair<int, int> > > A(n);
    for (int i = 0; i < n; i++) {
      A[i].first = i + 1;
      cin >> A[i].second.first >> A[i].second.second;
    }
    sort(A.begin(), A.end(), my_compare());
    long long int ans = 0, p = n - 1, q = n - 1;
    vector<int> B(n, 0), R(n, 1);
    for (int i = 200; i >= 1; i--) {
      int num = 0;
      for (int j = n; j >= 0; j--) {
        if (R[j] == 1) {
          if (A[j].second.first <= i && A[j].second.second >= i) {
            num++;
            if (num > k) {
              R[j] = 0;
              ans++;
              B[ans - 1] = A[j].first;
            }
          }
        }
      }
    }
    cout << ans << endl;
    for (int i = 0; i < ans; i++) {
      cout << B[i] << " ";
    }
    cout << endl;
  }
  return 0;
}
