#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007LL;
const int N = 2e5 + 10;
const long long Inf = 2242545357980376863LL;
const long long Log = 30;
long long b[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> b[i];
  for (int i = 1; i <= n; i++) {
    long long idx = -1;
    for (int j = n; j >= 1; j--)
      if (b[j] == 0) idx = j;
    cout << idx << ' ';
    b[idx]--;
    for (int i = 1; i <= idx - k; i++) b[i]--;
  }
  return 0;
}
