#include <bits/stdc++.h>
int fx[] = {-1, 0, +1, 0}, fy[] = {0, +1, 0, -1},
    ex[] = {-1, -1, 0, +1, +1, +1, 0, -1},
    ey[] = {0, +1, +1, +1, 0, -1, -1, -1};
using namespace std;
int n, k, t;
int b[2000], a[2000];
void put(int p, int x) {
  for (int j = t; j > p; j--) swap(a[j], a[j - 1]);
  a[p] = x;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &b[i]);
  for (int i = n - 1, j; i >= 0; i--) {
    for (j = 0; j < t && b[i]; j++)
      if (a[j] >= i + k) b[i]--;
    put(j, i);
    t++;
  }
  for (int i = 0; i < n; i++) printf("%d%c", a[i] + 1, i == n - 1 ? '\n' : ' ');
  return 0;
}
