#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int b[1000];
  int a[1000];
  int hash[1000] = {0};
  cin >> n >> k;
  int current;
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    if (b[i] == 0) {
      current = i;
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    a[i] = current + 1;
    hash[current] = 1;
    int index = current - k;
    for (int j = 0; j <= index; j++) {
      if (hash[j] == 0) {
        b[j]--;
        if (b[j] == 0) current = current < j ? current : j;
      }
    }
    if (current == a[i] - 1) {
      while (hash[current] != 0 || b[current] != 0) current++;
    }
  }
  cout << a[0];
  for (int i = 1; i < n; i++) {
    cout << " " << a[i];
  }
  cout << endl;
  return 0;
}
