#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1100;
int ans[MAXN];
int a[MAXN];
int main() {
  int n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = n - 1; i >= 0; --i) {
    int j = 0;
    for (; a[i]; ++j)
      if (ans[j] >= i + k) --a[i];
    for (int l = n - i - 1; l > j; l--) ans[l] = ans[l - 1];
    ans[j] = i;
  }
  for (int i = 0; i < n; i++) cout << ans[i] + 1 << " ";
  cout << endl;
  return 0;
}
