#include <bits/stdc++.h>
using namespace std;
const long maxn = 1005;
long a[maxn];
long b[maxn];
long n, q, choice, k;
bool used[maxn];
int main() {
  scanf("%ld%ld", &n, &k);
  for (q = 1; q <= n; q++) {
    scanf("%ld", &b[q]);
    used[q] = false;
  }
  for (long step = 1; step <= n; step++) {
    for (choice = 1; choice <= n; choice++)
      if (!used[choice]) {
        long temp = k + choice;
        long cht = 0;
        for (long pred = step - 1; pred >= 1; pred--)
          if (a[pred] >= temp) cht++;
        if (cht == b[choice]) break;
      }
    a[step] = choice;
    used[choice] = true;
    printf("%ld ", a[step]);
  }
}
