One day, Polycarp came up with the following simple problem: the numbers $$$0, 1, \ldots, n-1$$$ are given. Is it possible to arrange them so that the absolute difference of every adjacent pair of numbers is divisible by at least one of the numbers $$$k_1, k_2, \ldots, k_m$$$?
Polycarp spent a long time thinking about how to solve this problem and eventually realized that it is not so simple after all. Help him solve this problem.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^3$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$3 \leq n \leq 5 \cdot 10^{3}$$$; $$$1 \leq m \leq 10$$$).
The second line of each test case contains $$$m$$$ integers $$$k_{i}$$$ ($$$1 \leq k_i \leq \left\lfloor \frac{n}{3} \right\rfloor $$$).
Additional constraints on the input:
For each test case, output one of the following:
210 22 36 12
0 2 6 8 4 1 3 5 7 9-1