#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
template <class T>
T abs(T x) {
  return x > 0 ? x : -x;
}
int n;
int m;
int b[1000], a[1000];
int main() {
  cin >> n >> m;
  for (int i = 0; i < (n); i++) cin >> b[i];
  int t = 0;
  for (int i = (n)-1; i >= 0; i--) {
    int col = b[i];
    for (int j = 0; j <= t; j++) {
      if (col == 0) {
        for (int k = t; k > j; k--) a[k] = a[k - 1];
        a[j] = i;
        break;
      }
      if (a[j] >= i + m) col--;
    }
    t++;
  }
  for (int i = 0; i < (n); i++) cout << a[i] + 1 << ' ';
  cout << endl;
  return 0;
}
