Home > Back-end >  The c problem how to do ah
The c problem how to do ah

Time:11-28

Title description
Xiao gang wrote a set of integers a1, a2, a3... Bored, the an, xiao gang decided to rearrange it into another integer array b1, b2, b3, b4... Bn. Request a new row of the array of the same position number is different from the original array of digital namely ai!=bi, please help complete the BGF xiao gang, if there are multiple effective rearrange, please find the dictionary sequence the smallest one,

Enter
A total of T group T<=5 two lines in each group:
The first line number n n n<=100000
The second line, a total of n number of each number & lt;=n

O
Meet the conditions of minimum dictionary sequence in each group, does not meet the output Impossible

The sample input
3
4
1 2 3 4
4
1 1 2 3
3
1 1 1

Sample output
1 2 3 4
2, 3, 1 1
Impossible

Tip
30% & lt;=20;
100% & lt;=10000
  • Related