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