#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n, k;
  cin >> n >> k;
  int seg[n + 1][2];
  int cnt[201];
  for (int i = 0; i <= 200; i++) cnt[i] = 0;
  for (int i = 1; i <= n; i++) {
    cin >> seg[i][0] >> seg[i][1];
    for (int j = seg[i][0]; j <= seg[i][1]; j++) {
      cnt[j]++;
    }
  }
  vector<int> finall;
  while (1) {
    set<int> st;
    for (int i = 1; i <= 200; i++) {
      if (cnt[i] > k) st.insert(i);
    }
    if (st.size() == 0) break;
    int a = *(st.begin());
    int indexx = -1;
    int maxi = 0;
    for (int i = 1; i <= n; i++) {
      int aa = seg[i][0];
      int bb = seg[i][1];
      if (aa <= a) {
        int h = bb - a + 1;
        if (h > maxi) {
          maxi = h;
          indexx = i;
        }
      }
    }
    int l = seg[indexx][0];
    int r = seg[indexx][1];
    seg[indexx][0] = 200;
    seg[indexx][1] = -1;
    for (int i = l; i <= r; i++) cnt[i]--;
    finall.push_back(indexx);
  }
  sort(finall.begin(), finall.end());
  cout << finall.size() << endl;
  for (int i = 0; i < finall.size(); i++) cout << finall[i] << " ";
  return 0;
}
