#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:16000000")
#pragma warning(disable : 4996)
const int inf = 1 << 25;
const double eps = 1e-9;
int main(int argc, char* argv[]) {
  int n, k;
  cin >> n >> k;
  vector<int> b(n);
  for (int i = (0); i < (n); ++i) cin >> b[i];
  vector<int> a(n);
  for (int i = (0); i < ((int)a.size()); ++i) a[i] = i + 1;
  int L = n + k;
  for (int i = n - 1; i >= 0; --i) {
    int j = i;
    while (b[i] > 0) {
      swap(a[j], a[j + 1]);
      if (a[j] >= L) --b[i];
      ++j;
    }
    --L;
  }
  for (int i = (0); i < ((int)a.size()); ++i) printf("%d ", a[i]);
  return 0;
}
