#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const double pi = 4 * atan(1);
const int inf = 1 << 30;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int nCase = 0;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
template <class T>
inline bool read(T& n) {
  T x = 0, tmp = 1;
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-' && c != EOF) c = getchar();
  if (c == EOF) return false;
  if (c == '-') c = getchar(), tmp = -1;
  while (c >= '0' && c <= '9') x *= 10, x += (c - '0'), c = getchar();
  n = x * tmp;
  return true;
}
template <class T>
inline void write(T n) {
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  int len = 0, data[20];
  while (n) {
    data[len++] = n % 10;
    n /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
}
int b[1010], cnt[1010];
set<int> st[1010];
struct node {
  int id;
  node(int x) { id = x; }
  bool operator<(const node& rhs) const { return id > rhs.id; }
};
vector<int> G[1010];
priority_queue<node> que;
int main(int argc, const char* argv[]) {
  int n, k;
  cin >> n >> k;
  priority_queue<node> que;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &b[i]);
    if (b[i] == 0) que.push(node(i));
    for (int j = i + k; j <= n; ++j) G[j].push_back(i);
  }
  while (!que.empty()) {
    int u = que.top().id;
    que.pop();
    printf("%d ", u);
    int size = G[u].size();
    for (int i = 0; i < size; ++i) {
      int v = G[u][i];
      if (--b[v] == 0) que.push(node(v));
    }
  }
  puts("");
  return 0;
}
