#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  cin >> n >> k;
  vector<int> b(n);
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    int j = 0;
    while (b[j] != 0) ++j;
    cout << j + 1 << " ";
    b[j] = -1;
    for (j -= k; j >= 0; j--) --b[j];
  }
  cout << endl;
  return 0;
}
