Alternative Facts
Time limit1.5sMemory limit256 MB
Rearrange the array A into B so that the first L positions stay within K of the original values, making B lexicographically largest.
Statement
In the year 3020 AD, the inauguration of the 237th President of the United States was held. More precisely, it should be called the inaugurations of the presidents. Since the 2884 election, the United States has used an N-party system, so N presidents are elected.
Seohyun is a political reporter for a major news outlet and attended every inauguration. Seohyun found that the number of people who attended the -th president's inauguration is .
Seohyun now wants to write an article based on this. The article does not need to state facts, and an alternative fact is enough. A sequence of length is an alternative fact of sequence if it satisfies the following two conditions.
- is a rearrangement of in any order. That is, sorting and sorting give the same result.
- For every integer , . Here and are nonnegative integers that Seohyun has in mind.
Seohyun wants the alternative fact in the article to be as great as possible. Sequence is greater than sequence if, at the first index where they differ, . In other words, comes after in lexicographic order.
Find the greatest alternative fact for Seohyun.
Input
The first line contains a positive integer and nonnegative integers and . (, , )
The second line contains the sequence of length , separated by spaces. ()
Output
On the first line, print the greatest alternative fact of sequence , with the numbers separated by spaces.