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