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