#c22102. 稳定排序

稳定排序

Stable Sort

Problem Description

Given nn positive integers a1,a2,…,ana_1, a_2, \dots, a_n, after sorting them from small to large, output the rank of each number (for equal numbers, the one with the smaller original index comes first).

Input Format

The first line is an integer nn, the number of values.

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n.

Output Format

One line with nn integers: the answer.

Sample Input

5
3 9 5 3 2

Sample Output

2 5 4 3 1

Constraints

For 100%100\% of the data, 1≤n≤1051 \le n \le 10^5 and 1≤ai≤1091 \le a_i \le 10^9.