#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> b(n), a(n), used(n + 1, false);
  for (int i = 0; i < n; ++i) {
    cin >> b[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (!used[j]) {
        int count = 0;
        for (int l = 0; l < i; ++l) {
          count += (a[l] >= j + k);
        }
        if (count == b[j - 1]) {
          used[j] = true;
          a[i] = j;
          break;
        }
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    cout << a[i] << " ";
  }
  return 0;
}
