#include <bits/stdc++.h>
using namespace std;
int x[11111];
int n;
int res[1111];
int bit[10000];
int k;
bool udah[11111];
int mks(int u) {
  int res = 0;
  for (int i = u; i > 0; i -= (i & -i)) res += bit[i];
  return res;
}
void add(int u, int v) {
  for (int i = u; i <= 10000; i += (i & -i)) bit[i] += v;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &x[i]);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++)
      if (!udah[j] && ((i - 1) - mks(j - 1 + k)) == x[j]) {
        res[i] = j;
        udah[j] = 1;
        add(j, 1);
        break;
      }
  }
  for (int i = 1; i < n; i++) printf("%d ", res[i]);
  printf("%d\n", res[n]);
}
