405258: GYM101858 J Jaeger Training

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

J. Jaeger Trainingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

To become a Survey Corps people need to first graduate on Training Corps.

It's not an easy task, the outside is full of huge fearless titans, so the Training Corps needs to assert only the best cadets go through.

During one of the exams, $$$n$$$ cadets must traverse a circuit and score some points. The grade the $$$i$$$-th cadet earns is $$$n$$$ minus the number of cadets that finished the circuit before the him and scored at least the same amount of points.

You must calculate the grade each cadet earned during the exam.

Input

The first line of input contains one integer, $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of cadets doing the exam.

The next $$$n$$$ lines contains, each, one integer $$$s_i$$$ ($$$0 \le s_i \le 10^6$$$) — how many points the $$$i$$$-th cadet earned. The $$$i$$$-th cadet finished the circuit before the $$$j$$$-th cadet, if $$$i < j$$$.

Output

For each cadet you must print his grade.

ExamplesInput
3
1
2
3
Output
3
3
3
Input
5
5
4
3
2
3
Output
5
4
3
2
2

Source/Category

加入题单

算法标签: