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