#include <bits/stdc++.h>
using namespace std;
int n, k, B[2000], A[2000], val[2000][2000];
bool used[2000];
int main() {
  scanf("%d %d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &B[i]);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++)
      if (!used[j] && val[i - 1][j + k] == B[j]) {
        A[i] = j;
        for (int l = 1; l <= j; l++) val[i][l] = val[i - 1][l] + 1;
        for (int l = j + 1; l <= n + k; l++) val[i][l] = val[i - 1][l];
        used[j] = true;
        break;
      };
  };
  for (int i = 1; i <= n; i++) printf("%d ", A[i]);
  return 0;
}
