#include <bits/stdc++.h>
using namespace std;
int n, k;
int b[1010], a[1010];
bool was[1010];
int main() {
  memset(was, false, sizeof(was));
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (!was[j] && b[j] == 0) {
        was[j] = true;
        a[i] = j;
        int l = 1;
        while (l + k <= j) {
          if (!was[l]) --b[l];
          ++l;
        }
        break;
      }
    }
  }
  for (int i = 1; i <= n; ++i) printf("%d ", a[i]);
  return 0;
}
