#include <bits/stdc++.h>
using namespace std;
template <class T>
string tos(T x) {
  stringstream stringstream;
  stringstream << x;
  return stringstream.str();
}
void rot(vector<vector<int> > v, vector<vector<int> >& tmp, int r1, int c1,
         int r2, int c2) {
  tmp.resize(c2 - c1 + 1);
  int i, j;
  for (i = 0; i < tmp.size(); i++) tmp[i].resize(r2 - r1 + 1);
  for (i = r1; i <= r2; i++)
    for (j = c1; j <= c2; j++)
      tmp[j - c1][tmp[0].size() - (i - r1) - 1] = v[i][j];
}
bool isPal(string second) {
  int i = 0, j = second.size() - 1;
  while (i < j) {
    if (islower(second[i]) && islower(second[j]) && second[i] != second[j])
      return false;
    i++;
    j--;
  }
  return true;
}
bool* sieve(int n) {
  bool* prime = new bool[n + 1];
  memset(prime, 0, sizeof(prime));
  prime[0] = false;
  prime[1] = false;
  int m = (int)sqrt(n);
  for (int i = 2; i <= m; i++)
    if (prime[i])
      for (int k = i * i; k <= n; k += i) prime[k] = false;
  return prime;
}
int toD(int b, string second) {
  int res = 0, i, tmp = 1;
  int arr[256];
  for (i = 0; i < 256; i++) arr[i] = i - 48;
  for (i = 'a'; i <= 'z'; i++) arr[i] = i - 'a' + 10;
  for (i = second.size() - 1; i >= 0; i--)
    res += arr[second[i]] * tmp, tmp *= b;
  return res;
}
string toB(int b, int n) {
  string second = "0123456789abcdefghijklmnopqrstuvwxyz", res;
  if (!n) return "0";
  while (n) {
    res.push_back(second[n % b]);
    n /= b;
  }
  reverse(res.begin(), res.end());
  return res;
}
int gcd(int a, int b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int lcm(int a, int b) { return a * b / gcd(a, b); }
int inf = 10000000;
int n, k, B[10000], done[10000], ans[10000];
bool valid(int val, int pos) {
  int r = 0, i;
  for (i = pos - 1; i >= 0; i--) r += (ans[i] >= val + k);
  return (r >= B[val - 1]);
}
int main() {
  int i, j;
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> B[i];
  memset(done, 0, sizeof(done));
  for (i = 0; i < n; i++) {
    for (j = 1; j <= n; j++)
      if (!done[j] && valid(j, i)) break;
    ans[i] = j;
    done[j] = true;
  }
  cout << ans[0];
  for (i = 1; i <= n - 1; i++) cout << " " << ans[i];
  cout << endl;
  return 0;
}
