#include <bits/stdc++.h>
int b[1024];
int res[1024];
int rem[1024];
int main() {
  int i = 0, j = 0, k = 0;
  int n = 0, x = 0;
  while (scanf("%d %d", &n, &k) != EOF) {
    memset(res, 0, sizeof(res));
    memset(rem, 0, sizeof(rem));
    for (i = 0; i < n; i++) {
      scanf("%d", &b[i]);
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < n; j++) {
        if (rem[j] == 0 && b[j] == 0) {
          break;
        }
      }
      rem[j] = 1, x = j;
      for (j = 0; j < n; j++) {
        if (x >= j + k && b[j] > 0) b[j]--;
      }
      res[i] = x + 1;
    }
    printf("%d", res[0]);
    for (i = 1; i < n; i++) {
      printf(" %d", res[i]);
    }
    printf("\n");
  }
}
