#include <bits/stdc++.h>
int n, k;
int b[1000 + 5];
int a[1000 + 5];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &b[i]);
  for (int i = 1; i <= n; ++i) {
    int pos = 0;
    for (int j = 1; j <= n; ++j)
      if (b[j] == 0) {
        pos = j;
        break;
      }
    a[i] = pos;
    for (int j = 1; j <= pos - k; ++j) --b[j];
    --b[pos];
  }
  printf("%d", a[1]);
  for (int i = 2; i <= n; ++i) printf(" %d", a[i]);
}
