#include <bits/stdc++.h>
int findmin(int *b, int n, int k);
int main() {
  int i, j, k, n, *b, *a;
  scanf("%d%d", &n, &k);
  b = (int *)malloc(sizeof(int) * n);
  a = (int *)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) scanf("%d", &b[i]);
  for (i = 0; i < n; i++) {
    j = findmin(b, n, k);
    a[i] = j + 1;
    b[j] = -1;
  }
  for (i = 0; i < n - 1; i++) printf("%d ", a[i]);
  printf("%d\n", a[i]);
  return (0);
}
int findmin(int *b, int n, int k) {
  int i, index = -1;
  for (i = 0; i < n; i++) {
    if (b[i] == 0) {
      index = i;
      break;
    }
  }
  for (i = 0; i < n; i++) {
    if (b[i] > 0 && index >= i + k) b[i]--;
  }
  return (index);
}
