#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  vector<int> b(n + 1);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  vector<int> a(n + 1);
  for (int i = n - k + 1; i <= n; ++i) a[i] = i;
  for (int i = n - k; i >= 1; --i) {
    int count = b[i];
    int j = i;
    while (count > 0) {
      a[j] = a[j + 1];
      if (a[j] >= i + k) --count;
      ++j;
    }
    a[j] = i;
  }
  for (int i = 1; i <= n; ++i) printf("%d%c", a[i], (i < n) ? ' ' : '\n');
  return 0;
}
