#include <bits/stdc++.h>
using namespace std;
string lower(string s) {
  for (int i = 0; i < s.size(); i++) s[i] = tolower(s[i]);
  return s;
}
vector<string> sep(string s, char c) {
  string temp;
  vector<string> res;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == c) {
      if (temp != "") res.push_back(temp);
      temp = "";
      continue;
    }
    temp = temp + s[i];
  }
  if (temp != "") res.push_back(temp);
  return res;
}
template <class T>
T toint(string s) {
  stringstream ss(s);
  T ret;
  ss >> ret;
  return ret;
}
template <class T>
string tostr(T inp) {
  string ret;
  stringstream ss;
  ss << inp;
  ss >> ret;
  return ret;
}
template <class T>
void D(T A[], int n) {
  for (int i = 0; i < n; i++) cout << A[i] << " ";
  cout << endl;
}
template <class T>
void D(vector<T> A, int n = -1) {
  if (n == -1) n = A.size();
  for (int i = 0; i < n; i++) cout << A[i] << " ";
  cout << endl;
}
map<int, vector<int> > M;
int main() {
  int N, k;
  scanf("%d%d", &N, &k);
  for (int(i) = (0); (i) < (N); (i)++) {
    int a;
    scanf("%d", &a);
    M[a].push_back((i + 1));
  }
  vector<int> ans;
  for (typeof(M.begin()) it = M.begin(); it != M.end(); it++) {
    int a = it->first;
    vector<int> &tmp = it->second;
    if (a == 0) {
      for (int(i) = (0); (i) < (tmp.size()); (i)++) ans.push_back((tmp[i]));
      continue;
    }
    for (int(i) = (0); (i) < (tmp.size()); (i)++) {
      int ps = -1;
      int tv = 0;
      for (int(j) = (0); (j) < (ans.size()); (j)++) {
        if (ans[j] >= tmp[i] + k) tv++;
        if (tv > a) break;
        if (tv == a) {
          if (ans[j] > tmp[i] && ps != -1) break;
          ps = j;
        }
      }
      ans.insert(ans.begin() + ps + 1, tmp[i]);
    }
  }
  printf("%d", ans[0]);
  for (int(i) = (1); (i) < (ans.size()); (i)++) printf(" %d", ans[i]);
  printf("\n");
  return 0;
}
