#include <bits/stdc++.h>
using namespace std;
int ara[4002], b[4002];
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  for (int i = n; i >= 1; i--) {
    ara[i] = i;
    for (int j = i + 1; j <= n && b[i] > 0; j++) {
      ara[j - 1] = ara[j];
      if (ara[j] - i >= k) {
        b[i]--;
        if (b[i] == 0) {
          ara[j] = i;
          break;
        }
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    if (i == 1)
      cout << ara[i];
    else
      cout << " " << ara[i];
  }
  cout << endl;
  return 0;
}
