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