Couplet
题号:NC252114
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述

It's New Year's Day, and it was a tradition for ancient Chinese to write couplets. Sometimes one person would give the first line, and another person would need to come up with the second line based on the sentence structure and meaning, which requires considerable literary skills.

Now given a first line of length n, with each character represented by a number for convenience, you need to write a second line that meets the following requirements:

1. Each number in the second line must be a positive integer.
2. Each number in the second line must not appear in the first line.
3. The i-th number in the first line corresponds to the i-th number in the second line. You can specify the correspondence relationship arbitrarily, but the relationship must be consistent and unique.

For example, if you specify that the number 3 in the first line corresponds to the number 1 in the second line, then another non-3 number in the first line cannot correspond to the number 1, and all 3s in the first line must correspond to 1.

输入描述:

The first line contains a positive integer n (1 \le n \le 10^5), indicating the number of numbers. The second line contains n integers a_i (1 \le a_i \le 10^9), representing each number.

输出描述:

Output n integers representing the second line.

Since you can specify the correspondence relationship arbitrarily, there may be multiple possible solutions for the second line. You need to output the smallest one in lexicographic order.
示例1

输入

复制
6
3 3 4 2 4 7

输出

复制
1 1 5 6 5 8

说明

Let 3 correspond to 1, 4 correspond to 5, 2 correspond to 6, and 7 correspond to 8, then the second line is [1, 1, 5, 6, 5, 8]. This is the smallest in lexicographic order. If we let 3 correspond to 9, the second line would be [9, 9, 5, 6, 5, 8], which is also a valid second line, but not the smallest one required by the problem.