#c22707. 离散化

离散化

Discretization

Problem Description

You are given nn numbers a1,a2,…,ana_1, a_2, \dots, a_n.

Output the discretized result: for each aia_i, output its rank (1-based) among the distinct values after sorting them in ascending order.

Input Format

The first line contains an integer nn (1≤n≤1051 \le n \le 10^5).

The next line contains nn integers a1,a2,…,ana_1, a_2, \dots, a_n (1≤ai≤1091 \le a_i \le 10^9).

Output Format

Output one line containing nn integers.

Sample Input

5
5 3 5 2 5

Sample Output

3 2 3 1 3