#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  char c = getchar();
  long long f = 1, x = 0;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + (c ^ '0');
    c = getchar();
  }
  return x * f;
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  long long b[100009], a[100009];
  long long n = read();
  long long k = read();
  for (int i = 1; i <= n; i++) {
    b[i] = read();
  }
  for (int i = 1; i <= n; i++) {
    long long flag = 1;
    while (b[flag] != 0) {
      flag++;
    }
    a[i] = flag;
    b[flag]--;
    for (long long j = 1; j + k <= flag; j++) {
      b[j]--;
    }
  }
  for (int i = 1; i <= n; i++) {
    printf("%d", a[i]);
    if (i != n) {
      printf(" ");
    }
  }
  return 0;
}
