Task
You are given an array of length .
Find any array of length which satisfies all of the following conditions:
- is a permutation of ;
- For all (), is not divisibile by .
If no such array exists, print -1
instead.
An array is a permutation of another array if contains the same elements as , but potentially in another order. For example, is a permutation of , but is not a permutation of .
Input data
Each test contains multiple test cases. The first line of input contains a single integer () - the number of test cases. The next lines contain the descriptions of the test cases.
The first line of each test case contains a single integer () - the length of array .
The second line of each test case contains integers () - the elements of array .
It is guaranteed that the sum of across all test cases does not exceed .
Output data
For each test case, print any array which satisfies all of the conditions from the statement.
If no such arrays exist, print -1
instead.
Example
stdin
7
1
1
4
2 2 2 2
5
1 2 3 1 2
6
8 7 8 9 7 4
7
2 3 4 5 6 7 8
8
8 1 2 7 7 9 6 10
9
6 11 4 5 8 9 11 3 4
stdout
1
-1
-1
4 7 8 9 7 8
8 2 3 4 5 6 7
10 9 1 8 6 7 2 7
11 3 11 6 9 4 5 4 8
Explanation
In the first test case, is a valid permutation of , since:
- , which is not divisible by .
We can show that there are no solutions for the second and third test cases.
In the fourth test case, is a valid permutation of , since:
- , which is not divisible by .
- , which is not divisible by .
- , which is not divisible by .
- , which is not divisible by .
- , which is not divisible by .
- , which is not divisible by .