AT_abc399_b [ABC399B] Ranking with Ties

Description

$ N $ people labeled from $ 1 $ to $ N $ participated in a certain contest. The **score** of person $ i $ ( $ 1 \leq i \leq N $ ) was $ P_i $ . In this contest, the **rank** of each of the $ N $ people is determined by the following procedure: 1. Prepare a variable $ r $ , and initialize $ r = 1 $ . Initially, the ranks of the $ N $ people are all undetermined. 2. Repeat the following operation until the ranks of all $ N $ people are determined: - Let $ x $ be the maximum score among the people whose ranks are currently undetermined, and let $ k $ be the number of people whose score is $ x $ . Determine the rank of those $ k $ people with score $ x $ to be $ r $ , and then add $ k $ to $ r $ . Print the rank of each of the $ N $ people.

Input Format

The input is given from Standard Input in the following format: > $ N $ $ P_1 $ $ P_2 $ $ \dots $ $ P_N $

Output Format

Print $ N $ lines. The $ i $ -th line ( $ 1 \leq i \leq N $ ) should contain the rank of person $ i $ as an integer.

Explanation/Hint

### Sample Explanation 1 The ranks of the $ N\ (=4) $ people are determined as follows: 1. Prepare a variable $ r $ and initialize $ r=1 $ . At first, the ranks of all $ 4 $ people are undetermined. 2. Currently, persons $ 1, 2, 3, 4 $ have undetermined ranks. The maximum score among them is $ P_2\ (=12) $ . Therefore, determine the rank of person $ 2 $ to be $ r\ (=1) $ , and then add $ 1 $ to $ r $ , making $ r=2 $ . 3. Currently, persons $ 1, 3, 4 $ have undetermined ranks. The maximum score among them is $ P_3=P_4\ (=9) $ . Therefore, determine the ranks of persons $ 3 $ and $ 4 $ to be $ r\ (=2) $ , and then add $ 2 $ to $ r $ , making $ r=4 $ . 4. Currently, person $ 1 $ has an undetermined rank. The maximum score among them is $ P_1\ (=3) $ . Therefore, determine the rank of person $ 1 $ to be $ r\ (=4) $ , and then add $ 1 $ to $ r $ , making $ r=5 $ . 5. The ranks of all $ 4 $ people are now determined, so the process ends. ### Constraints - $ 1\leq N \leq 100 $ - $ 1\leq P_i \leq 100 $ - All input values are integers.