#include <bits/stdc++.h>
using namespace std;
int n, k, b[1010];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    int x = 0;
    while (b[x]) x++;
    cout << x + 1 << " ";
    b[x] = -1;
    for (int j = 0; j < x - k + 1; j++) b[j]--;
  }
}
