Good Bye 2013
C
New Year Ratings Change
Codeforces
1400
原题
← BD →
翻译中…

One very well-known internet resource site (let's call it X) has come up with a New Year adventure. Specifically, they decided to give ratings to all visitors.

翻译中…

There are $*n*$ users on the site, for each user we know the rating value he wants to get as a New Year Present. We know that user $*i*$ wants to get at least $*a*_{*i*}$ rating units as a present.

翻译中…

The X site is administered by very creative and thrifty people. On the one hand, they want to give distinct ratings and on the other hand, the total sum of the ratings in the present must be as small as possible.

翻译中…

Help site X cope with the challenging task of rating distribution. Find the optimal distribution.

翻译中…

Input

翻译中…

The first line contains integer $*n*$ $(1 ≤ *n* ≤ 3·10^{5})$ — the number of users on the site. The next line contains integer sequence $*a*_{1}, *a*_{2}, ..., *a*_{*n*}$ $(1 ≤ *a*_{*i*} ≤ 10^{9})$.

翻译中…

Output

翻译中…

Print a sequence of integers $*b*_{1}, *b*_{2}, ..., *b*_{*n*}$. Number $*b*_{*i*}$ means that user $*i*$ gets $*b*_{*i*}$ of rating as a present. The printed sequence must meet the problem conditions.

翻译中…

If there are multiple optimal solutions, print any of them.

翻译中…

样例

Input #1
3
5 1 1
Output #1
5 1 2
InputCopy OutputCopy
Input #2
1
1000000000
Output #2
1000000000
InputCopy OutputCopy
题目信息
题号
379C
所属比赛
时间限制
1 s
内存限制
256 MB
标签
贪心
排序

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