#include <bits/stdc++.h>
using namespace std;
int p[1005], q, a[1005];
int main() {
  int i, j, k, n, m, x, kk;
  scanf("%d%d", &n, &m);
  for (i = 0; i <= n; i++) p[i] = i;
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (i = n; i >= 1; i--) {
    k = 0;
    while (a[i]) {
      k = p[k];
      if (k >= i + m) a[i]--;
    }
    if (p[k] == k)
      p[k] = i;
    else {
      kk = p[k];
      p[k] = i;
      p[i] = kk;
    }
  }
  k = p[0];
  while (p[k] != k) {
    printf("%d ", k);
    k = p[k];
  }
  printf("%d\n", k);
  return 0;
}
