Codeforces Round 307 (Div. 2)
A
GukiZ and Contest
Codeforces
800
原题
←B →
翻译中…

Professor GukiZ likes programming contests. He especially likes to rate his students on the contests he prepares. Now, he has decided to prepare a new contest.

翻译中…

In total, $*n*$ students will attend, and before the start, every one of them has some positive integer rating. Students are indexed from $1$ to $*n*$. Let's denote the rating of $*i*$-th student as $*a*_{*i*}$. After the contest ends, every student will end up with some positive integer position. GukiZ expects that his students will take places according to their ratings.

翻译中…

He thinks that each student will take place equal to image. In particular, if student $*A*$ has rating strictly lower then student $*B*$, $*A*$ will get the strictly better position than $*B*$, and if two students have equal ratings, they will share the same position.

翻译中…

GukiZ would like you to reconstruct the results by following his expectations. Help him and determine the position after the end of the contest for each of his students if everything goes as expected.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ ($1 ≤ *n* ≤ 2000$), number of GukiZ's students.

翻译中…

The second line contains $*n*$ numbers $*a*_{1}, *a*_{2}, ... *a*_{*n*}$ ($1 ≤ *a*_{*i*} ≤ 2000$) where $*a*_{*i*}$ is the rating of $*i*$-th student ($1 ≤ *i* ≤ *n*$).

翻译中…

Output

翻译中…

In a single line, print the position after the end of the contest for each of $*n*$ students in the same order as they appear in the input.

翻译中…

Note

翻译中…

In the first sample, students $2$ and $3$ are positioned first (there is no other student with higher rating), and student $1$ is positioned third since there are two students with higher rating.

翻译中…

In the second sample, first student is the only one on the contest.

翻译中…

In the third sample, students $2$ and $5$ share the first position with highest rating, student $4$ is next with third position, and students $1$ and $3$ are the last sharing fourth position.

翻译中…

样例

Input #1
3
1 3 3
Output #1
3 1 1
InputCopy OutputCopy
Input #2
1
1
Output #2
1
InputCopy OutputCopy
Input #3
5
3 5 3 4 5
Output #3
4 1 4 3 1
InputCopy OutputCopy
题目信息
题号
551A
时间限制
2 s
内存限制
256 MB
标签
暴力
模拟
排序

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。