#include <bits/stdc++.h>
using namespace std;
int data[1000];
int n, p;
int iTree[1 << 11];
const int base = (1 << 10);
bool isUsed[1000];
int ans[1000];
int getVal(int ts, int te, int cs, int ce, int ind) {
  if (ts >= te || cs >= ce) return 0;
  if (ts >= ce || cs >= te) return 0;
  if (ts == cs && te == ce) return iTree[ind];
  int mid = (cs + ce) / 2;
  int ret = getVal(ts, min(te, mid), cs, mid, ind * 2);
  ret += getVal(max(ts, mid), te, mid, ce, ind * 2 + 1);
  return ret;
}
void update(int ind) {
  ind += base;
  iTree[ind] = 1;
  ind /= 2;
  while (ind) {
    iTree[ind] = iTree[ind * 2] + iTree[ind * 2 + 1];
    ind /= 2;
  }
}
int main(void) {
  scanf("%d %d", &n, &p);
  for (int i = 0; i < n; i++) scanf("%d", data + i);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (isUsed[j]) continue;
      int sum = getVal(j + p, n, 0, base, 1);
      if (sum == data[j]) {
        isUsed[j] = true;
        update(j);
        ans[i] = j + 1;
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
