#include <bits/stdc++.h>
using namespace std;
int main(int argc, char **argv) {
  vector<pair<int, int> > S;
  int N, K;
  cin >> N >> K;
  for (int i = (0); i < (N); ++i) {
    int first;
    cin >> first;
    S.push_back(make_pair(first, i + 1));
  }
  sort(S.begin(), S.end());
  vector<int> res;
  vector<int> cnt(N, 0);
  vector<bool> used(N, 0);
  for (int i = (0); i < (S.size()); ++i) {
    int ptr = -1, make_pair = 1 << 29;
    ;
    for (int j = (0); j < (N); ++j)
      if (cnt[S[j].second - 1] >= S[j].first && !used[S[j].second - 1])
        if (make_pair > S[j].second) make_pair = S[j].second, ptr = j;
    int p = S[ptr].first, q = S[ptr].second;
    for (int j = (0); j < (N); ++j)
      if (j + 1 + K <= q) cnt[j]++;
    used[q - 1] = 1;
    res.push_back(q);
  }
  for (int i = (0); i < (N); ++i) printf("%d ", res[i]);
  puts("");
  return 0;
}
