#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
void put1() { puts("Yes"); }
void put2() { puts("No"); }
void put3() { puts("-1"); }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
using namespace std;
const int manx = 2e5 + 10;
long long a[manx], b[manx];
int main() {
  long long n = read(), k = read();
  for (int i = 1; i <= n; i++) b[i] = read();
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (b[j] == 0) {
        a[i] = j;
        b[j] = -1;
        for (int l = 1; l + k <= j; l++)
          if (b[l]) b[l]--;
        break;
      }
    }
  }
  for (int i = 1; i <= n; i++) printf("%lld ", a[i]);
  return 0;
}
