#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> a(n);
    for (auto &it : a)
        cin >> it;

    vector<int> p(n);
    iota(p.begin(), p.end(), 0);

    do
    {
        vector<int> cur(n);
        for (int i = 0; i < n; i++)
        {
            const auto it = find(p.begin(), p.end(), i);
            assert(it != p.end());
            cur[i] = count_if(it, p.end(), [&] (const int x) {return x > i;});
        }

        if (cur == a)
        {
            for (int i = 0; i < n; i++)
                cout << p[i] + 1 << " \n"[i + 1 == n];
            return 0;
        }
    } while (next_permutation(p.begin(), p.end()));

    assert(false);
}
