#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int i, j, t;
  int a[1010], b[1010];
  while (cin >> n >> k) {
    for (i = 1; i <= n; i++) {
      cin >> a[i];
    }
    for (i = 1; i <= n; i++) {
      j = 1;
      while (a[j] != 0) {
        j++;
      }
      b[i] = j;
      a[j]--;
      for (t = 1; t + k <= j; t++) {
        a[t]--;
      }
    }
    for (i = 1; i < n; i++) {
      cout << b[i] << ' ';
    }
    cout << b[n] << endl;
  }
  return 0;
}
