#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int a[1010], b[1010];
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> b[i];
  vector<int> v;
  int i = n;
  while (b[i] == 0 && i > 0) {
    i--;
  }
  i++;
  for (i; i <= n; i++) v.push_back(i);
  for (i = v[0] - 1; i > 0; i--) {
    int l = 0;
    if (b[i] == 0) {
      while (v[l] <= i) l++;
      v.insert(v.begin() + l, i);
      continue;
    }
    for (int j = 0; j <= (int)v.size(); j++) {
      if (v[j] >= i + k) l++;
      if (l == b[i]) {
        v.insert(v.begin() + j + 1, i);
        break;
      }
    }
  }
  for (int i = 0; i < (int)v.size(); i++) cout << v[i] << ' ';
  return 0;
}
