#include <bits/stdc++.h>
using namespace std;
int dx4[4] = {0, -1, 0, 1};
int dy4[4] = {1, 0, -1, 0};
int dx8[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
int dy8[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
int Power(int base, int exp) {
  int ans = 1;
  while (exp > 0) {
    if (exp & 1) ans = (1LL * ans * base) % 1000000007;
    exp = exp >> 1;
    base = (1LL * base * base) % 1000000007;
  }
  return ans;
}
void input() {
  int n, k;
  cin >> n >> k;
  vector<int> a, b(n), vis(n + 1, 0);
  for (int i = 0; i < n; i += 1) cin >> b[i];
  for (int ii = 0; ii < n; ii += 1) {
    vector<int> cnt(1005, 0);
    for (int i = 0; i < (int)a.size(); i += 1) cnt[a[i]]++;
    for (int i = 0; i < 1005; i += 1)
      if (i) cnt[i] += cnt[i - 1];
    for (int i = 1; i < n + 1; i += 1) {
      if (vis[i]) continue;
      int j = min(1004, i + k);
      int bb = cnt[1004] - cnt[j - 1];
      if (bb == b[i - 1]) {
        a.push_back(i);
        vis[i] = 1;
        break;
      }
    }
  }
  for (int i = 0; i < n; i += 1) cout << a[i] << ' ';
  cout << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  while (q--) input();
}
