#include <bits/stdc++.h>
using namespace std;
double const pi = 3.1415926535897932384626433832795;
int const inf = (int)1e9;
long long const inf64 = (long long)2e18;
const string name = "b";
int const NMAX = 1001;
int n, k;
int b[NMAX];
int used[NMAX];
int main() {
  cin >> n >> k;
  for (int i = 0; i < (int)n; i++) {
    scanf("%d", &b[i]);
  }
  memset(used, 0, sizeof(used));
  for (int i = 0; i < (int)n; i++) {
    int now = -1;
    for (int j = 0; j < (int)n; j++)
      if (!used[j] && b[j] == 0) {
        now = j;
        break;
      }
    printf("%d ", now + 1);
    used[now] = true;
    for (int j = 0; j < (int)now - k + 1; j++)
      if (!used[j]) b[j]--;
  }
  return 0;
}
