#include <bits/stdc++.h>
using namespace std;
const int N = 1010;
const int BS = 5;
int n, k, a[N];
bool f[N];
int b[N];
int u[N];
void modify(int x, int v) {
  for (x += BS; x < N; x += x & -x) u[x] += v;
}
int getsum(int x) {
  int s = 0;
  for (x += BS; x; x -= x & -x) s += u[x];
  return s;
}
int check(int i) {
  if (i + k > n) return b[i] == 0;
  return getsum(n) - getsum(i + k - 1) == b[i];
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", b + i);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (f[j]) continue;
      if (check(j)) {
        a[i] = j;
        f[j] = 1;
        modify(j, 1);
        break;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    printf("%d%c", a[i], " \n"[i == n - 1]);
  }
  return 0;
}
