#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
int n, k, b[maxn];
bool mark[maxn];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (!mark[j] && b[j] == 0) {
        cout << j << ' ';
        mark[j] = 1;
        for (int t = 1; t + k <= j; t++) b[t]--;
        break;
      }
    }
  }
  cout << endl;
  return 0;
}
