#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:256000000")
using namespace std;
int gcd(int a, int b) {
  while (a != 0 && b != 0) {
    if (a > b) {
      a %= b;
    } else {
      b %= a;
    }
  }
  return a + b;
}
int main() {
  int n, k, a[1013], ans[1013], b[1013], ca = 1;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  memset(b, 0, sizeof(b));
  for (int i = 1; i <= n; i++) {
    if (b[i]) continue;
    while (a[i] != 0) {
      int j;
      for (j = i + k; (b[j]) || (a[j] != 0); j++)
        ;
      for (int z = i + 1; z < j; z++) {
        if ((!b[z]) && a[z] == 0) {
          b[z] = 1;
          ans[ca] = z;
          ca++;
        }
      }
      for (int z = 1; z <= j - k; z++) {
        a[z]--;
      }
      b[j] = 1;
      ans[ca] = j;
      ca++;
    }
    b[i] = 1;
    ans[ca] = i;
    ca++;
  }
  for (int i = 1; i <= n; i++) {
    cout << ans[i] << ' ';
  }
  return 0;
}
