#include <bits/stdc++.h>
using namespace std;
template <typename S, typename T>
ostream& operator<<(ostream& out, pair<S, T> const& p) {
  out << '(' << p.first << ", " << p.second << ')';
  return out;
}
template <typename T>
ostream& operator<<(ostream& out, vector<T> const& v) {
  long long l = v.size();
  for (long long i = 0; i < l - 1; i++) out << v[i] << ' ';
  if (l > 0) out << v[l - 1];
  return out;
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << "\n";
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const long long N = 2e4;
long long arr[N], brr[N], n, k;
void insrt(long long no, long long pos) {
  long long temp1 = no;
  long long temp2 = arr[pos];
  for (long long i = pos; i <= n; i++) {
    arr[i] = temp1;
    temp1 = temp2;
    temp2 = arr[i + 1];
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) {
    cin >> brr[i];
  }
  arr[1] = n;
  for (long long i = n - 1; i >= 1; i--) {
    long long req = brr[i];
    long long curp = 1;
    while (req > 0) {
      if (arr[curp] >= i + k) {
        req--;
      }
      curp++;
    }
    insrt(i, curp);
  }
  for (long long i = 1; i <= n; i++) {
    cout << arr[i] << " ";
  }
  cout << "\n";
}
