#include <bits/stdc++.h>
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 5;
using namespace std;
int a[1005] = {0}, b[1005] = {0};
int n, k;
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &b[i]);
  for (int i = 1; i <= n; i++) {
    int cur = 1;
    while (b[cur] != 0) cur++;
    a[i] = cur;
    b[cur]--;
    for (int j = 1; j + k <= cur; j++) b[j]--;
  }
  for (int i = 1; i < n; i++) printf("%d ", a[i]);
  printf("%d\n", a[n]);
  return 0;
}
