Problem Description

Jacob is participating in a tennis competition. This tennis competition has a total of N competitors, and the ith competitor has won Ai points by the end of the competition.

Jacob wants to know the rank of each of the competitors, where one's rank is determined by the number of unique scores above them, plus one. Refer to the sample cases for more details.

Limits

For all tests: 0 ≤ Ai ≤ 109.

Subtask 1 (15%): 1 ≤ N ≤ 1000, Ai ≠ Aj if i ≠ j.

Subtask 2 (25%): 1 ≤ N ≤ 1000.

Subtask 3 (20%): 1 ≤ N ≤ 200000, Ai ≠ Aj if i ≠ j.

Subtask 4 (40%): 1 ≤ N ≤ 200000.

Subtask 5 (0%): Sample Testcases.

Input

The first line of input will contain one integer, N.

The second line of input will contain N integers, representing the array A.

Output

The only line of output should contain N integers, with the ith integer representing the rank of competitor i.

Sample Testcase 1

Input

5
1 4 10 4 6

Output

4 3 1 3 2

Sample Testcase 2

Input

8
1 8 4 1 3 5 1 2

Output

6 1 3 6 4 2 6 5