#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, r;
  cin >> n >> r;
  vector<int> sor(n);
  for (int i = 0; i < n; i++) cin >> sor[i];
  vector<int> mo;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (sor[j] == 0) {
        mo.push_back(j);
        sor[j]--;
        for (int k = j - r; k >= 0; k--) sor[k]--;
        break;
      }
    }
  }
  for (int x : mo) cout << x + 1 << " ";
  return 0;
}
