#include <stdio.h>
#include <assert.h>

int main() {
    FILE *fr, *fw;
    int N, current_value, old_value, i;

#ifdef EVAL
    fr = fopen("input.txt", "r");
    fw = fopen("output.txt", "w");
#else
    fr = stdin;
    fw = stdout;
#endif
    assert(1 == fscanf(fr, "%d", &N));
    assert(1 == fscanf(fr, "%d", &current_value));

    for (i=100; i > current_value; i--)
        fprintf(fw, "0 ");

    int count = 1;
    for (i = 1; i < N; i++) {
        old_value = current_value;
        assert(1 == fscanf(fr, "%d", &current_value));
        if (current_value != old_value) {
            for (int j = old_value; j > current_value; j--)
                fprintf(fw, "%d ", count);
        }
        count++;
    }
    for (int j = current_value; j >= 0; j--)
        fprintf(fw, "%d ", count);
    fclose(fr);
    fclose(fw);
    return 0;
}
