#include <bits/stdc++.h>
using namespace std;
int b[int(2e5) + 10], taken[int(2e5) + 10], greaterthan[int(2e5) + 10];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, k;
  cin >> n >> k;
  for (int i = 1; i < n + 1; i++) cin >> b[i];
  int num = 1;
  for (int i = 1; i < n + 1; i++) {
    int found = 0;
    for (int j = 1; j < n + 1; j++) {
      if (greaterthan[j + k] == b[j] && !taken[j]) {
        taken[j] = num++;
        found = j;
        break;
      }
    }
    for (int j = 1; j < found + 1; j++) greaterthan[j]++;
  }
  for (int i = 1; i < n + 1; i++) {
    b[taken[i]] = i;
  }
  for (int i = 1; i < n + 1; i++) cout << b[i] << " ";
}
