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