#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
long long sum[N], ans[N], cur;
long long seg[1 << 20];
set<int> nw;
void update(int i, int v, int ni = 0, int ns = 0, int ne = n) {
  if (ns > i || ne < i || ns > ne) return;
  if (ns == ne && ns == i) {
    seg[ni] += v;
    return;
  }
  if (ns >= ne) return;
  int l = ni * 2 + 1, r = l + 1, mid = (ns + ne) / 2;
  update(i, v, l, ns, mid);
  update(i, v, r, mid + 1, ne);
  seg[ni] = seg[l] + seg[r];
}
long long query(int qs, int qe, int ni = 0, int ns = 0, int ne = n) {
  if (ns > qe || ne < qs || ns > ne) return 0;
  if (ns >= qs && ne <= qe) return seg[ni];
  int l = ni * 2 + 1, r = l + 1, mid = (ns + ne) / 2;
  return query(qs, qe, l, ns, mid) + query(qs, qe, r, mid + 1, ne);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) scanf("%lld", sum + i);
  for (int i = 1; i <= n; ++i) nw.insert(i);
  for (int i = n - 1; i >= 0; --i) {
    int st = 0, en = n - 1;
    while (st < en) {
      int mid = (st + en + 1) / 2;
      long long s = 1ll * mid * (mid + 1) / 2 - query(0, mid);
      if (s > sum[i])
        en = mid - 1;
      else
        st = mid;
    }
    int x = *nw.lower_bound(st + 1);
    nw.erase(x);
    ans[i] = x;
    update(x, x);
  }
  for (int i = 0; i < n; ++i) printf("%lld ", ans[i]);
  return 0;
}
