#d2465. 订单重编号
订单重编号
Order Renumbering
Problem Description
You are given positive integers in chronological order, representing the original order numbers. You need to assign a new number to each order, in the same order: for each order, the new number is the smallest integer that is greater than or equal to its original number and has not been used before.
For example, if the original numbers are in order, then the new numbers are : the first three orders keep their unused original numbers; the fourth order has original number , but are already used, so its new number is .
Input Format
The first line contains an integer ().
The second line contains integers (), representing the original order numbers.
Output Format
Output one line containing integers: the new order numbers.
Sample Input 1
6
2 3 4 1 1 1
Sample Output 1
2 3 4 1 5 6
Sample Input 2
3
1000000000 1000000000 1000000000
Sample Output 2
1000000000 1000000001 1000000002
Sample Input 3
6
4 5 1 2 1 1
Sample Output 3
4 5 1 2 3 6