#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int n, k;
int nxt[maxn];
pair<int, int> a[maxn];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i].first), a[i].second = i;
  sort(a + 1, a + 1 + n);
  int first = 0;
  for (int i = 1; i <= n; ++i) {
    int x = a[i].second, need = a[i].first;
    if (!first)
      first = x;
    else if (!need) {
      int j = first;
      while (nxt[j]) j = nxt[j];
      nxt[j] = x;
    } else {
      int j = first;
      while (1) {
        if (j >= x + k) --need;
        if (need == 0) {
          int mn = x;
          while (nxt[j])
            if (nxt[j] < x)
              j = nxt[j];
            else
              break;
          nxt[x] = nxt[j];
          nxt[j] = x;
          break;
        }
        j = nxt[j];
      }
    }
  }
  while (first) {
    printf("%d ", first);
    first = nxt[first];
  }
  return 0;
}
