#include <bits/stdc++.h>
int next[1010];
int b[1010];
int n, m;
int main() {
  int i, j, k;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", b + i);
  memset(next, -1, sizeof(next));
  next[0] = n;
  for (i = n - 1; i > 0; i--) {
    int tot = 0;
    for (k = 0; k != -1; k = next[k]) {
      if (k >= i + m) tot++;
      if (tot == b[i]) {
        next[i] = next[k];
        next[k] = i;
        break;
      }
    }
  }
  for (i = next[0]; i != -1; i = next[i]) printf("%d ", i);
  printf("\n");
  return 0;
}
