#include <bits/stdc++.h>
int main() {
  int n, k;
  int i, j, x, y;
  int b[1002];
  while (scanf("%d%d", &n, &k) != EOF) {
    x = n;
    for (i = 1; i <= n; i++) scanf("%d", &b[i]);
    while (x) {
      for (i = 1; i <= n; i++)
        if (b[i] == 0) {
          if (x == n)
            printf("%d", i);
          else
            printf(" %d", i);
          x--;
          b[i] = -1;
          break;
        }
      for (j = 1; j <= i - k; j++) b[j]--;
    }
    printf("\n");
  }
  return 0;
}
