#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
const int INF = 1e9 + 7;
int a[N], b[N];
bool used[N];
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    int ind = 0;
    for (int j = 1; j <= n && !ind; j++) {
      if (!b[j] && !used[j]) {
        ind = j;
        used[j] = true;
      }
    }
    a[i] = ind;
    for (int j = 1; j <= ind - k; j++) {
      if (!used[j]) b[j]--;
    }
  }
  for (int i = 1; i <= n; i++) cout << a[i] << ' ';
}
