#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 5, inf = 1e9 + 7;
int n, k;
int b[MAX_N];
int a[MAX_N];
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> b[i];
  for (int i = 0; i < n; i++) {
    int ind = 0;
    while (b[ind]) ind++;
    cout << ind + 1 << " ";
    b[ind] = inf;
    for (int j = 0; j + k <= ind; j++) b[j]--;
  }
  return 0;
}
