#include <bits/stdc++.h>
using namespace std;
const int maxN = 1e3 + 10;
int n, k, a[maxN], b[maxN];
struct cmp {
  bool operator()(int x, int y) { return x > y; }
};
priority_queue<int, vector<int>, cmp> heap;
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) scanf("%i", &a[i]);
  for (int i = 1; i <= n; i++)
    if (a[i] == 0) heap.push(i);
  int m = 0;
  while (!heap.empty()) {
    int x = heap.top();
    heap.pop();
    b[++m] = x;
    for (int i = 1; i + k <= x; i++)
      if (a[i] > 0) {
        --a[i];
        if (a[i] == 0) heap.push(i);
      }
  }
  for (int i = 1; i <= n; i++) printf("%i ", b[i]);
}
