#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int sz(const T& x) {
  return (int)x.size();
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  vector<int> b(n);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  list<int> a;
  int i = n;
  while (!b.empty()) {
    int bi = b.back();
    b.pop_back();
    int s = 0;
    list<int>::iterator it = a.begin();
    while (s < bi && it != a.end()) {
      if (*it >= i + k) ++s;
      advance(it, 1);
    }
    a.insert(it, i);
    --i;
  }
  for (list<int>::iterator it = a.begin(); it != a.end(); ++it) {
    if (it != a.begin()) cout << ' ';
    cout << *it;
  }
  cout << '\n';
  return 0;
}
