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