#include <bits/stdc++.h>
int n, k;
int arr[1005];
int ans[1005], len = 1;
int main() {
  scanf("%d%d", &n, &k);
  int i, j, w;
  for (i = 1; i <= n; i++) scanf("%d", arr + i);
  ans[len++] = n;
  for (i = n - 1; i >= 1; i--) {
    int u = i + k;
    for (j = 0; j < len; j++) {
      if (ans[j] >= u) arr[i]--;
      if (arr[i] == 0) break;
    }
    j++;
    for (w = len - 1; w >= j; w--) ans[w + 1] = ans[w];
    ans[j] = i;
    len++;
  }
  for (i = 1; i < len; i++) printf("%d ", ans[i]);
  return 0;
}
