#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k, b[1024];
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) cin >> b[i];
  list<int> a;
  for (int i = n; i > 0; --i) {
    list<int>::iterator it = a.begin();
    while (it != a.end() && b[i] > 0)
      if (*it++ >= i + k) --b[i];
    a.insert(it, i);
  }
  for (list<int>::const_iterator it = a.begin(); it != a.end(); ++it)
    cout << (it == a.begin() ? "" : " ") << *it;
  cout << endl;
  return 0;
}
