New Year Ratings Change

题意翻译

一个非常有名的互联网资源网站(让我们称之为X)已经提出了一个新的挑战。具体来说,他们决定给所有参观者评rating。 网站上有n个用户,对于每个用户,我们都知道他希望作为新年礼物得到的rating值。我们知道,用户i想至少拿到一个$a_i$的评价单位作为礼物。 X站点由非常有创造力并且有节制的人管理。一方面,他们希望对所有人给出不同的rating,另一方面,所有人评级的总和必须尽可能小。 帮助网站X应对评级分配的挑战性任务。找到最佳分配。 输入 第一行一个整数n$(0 <= n <= 3 \times 10^5)$,表示这个网站用户的数量。 接下来一个序列$a_i$表示每个人想要的rating值$(0 <= a_i <= 10^9)$。 输出 一个序列$b_1,b_2,...b_n$, $b_i$表示第i个用户得到的rating. 如果有多种最佳方案,输出任意一个。

题目描述

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.

输入输出格式

输入格式


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}) $ .

输出格式


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.

输入输出样例

输入样例 #1

3
5 1 1

输出样例 #1

5 1 2

输入样例 #2

1
1000000000

输出样例 #2

1000000000