#include <bits/stdc++.h>
using namespace std;
int ti[1010], tree[1010];
int ans[1010];
int n, k;
void ins(int x) {
  if (x <= 0) return;
  for (; 0 < x; x -= x & -x) ++tree[x];
}
int find(int x) {
  int tot = 0;
  for (; x <= n; x += x & -x) tot += tree[x];
  return tot;
}
void solve() {
  memset(tree, 0, sizeof(tree));
  for (int i = 1; i <= n; ++i)
    for (int cur, j = 1; j <= n; ++j) {
      if (ti[j] == -1) continue;
      cur = find(j);
      if (cur == ti[j]) {
        ans[i] = j;
        ti[j] = -1;
        ins(j - k);
        break;
      }
    }
  printf("%d", ans[1]);
  for (int i = 2; i <= n; ++i) printf(" %d", ans[i]);
  puts("");
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; ++i) scanf("%d", &ti[i]);
  solve();
  return 0;
}
