Codeforces
CF Step
Youtube Linkedin Discord Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Statement : G. Simple Problem

G. Simple Problem

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.


Input

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:

  • the sum of $n$ over all test cases does not exceed $5 \cdot 10^{3}$.

Output

For each test case, output one of the following:

  • -1 on a single line if no suitable arrangement exists;
  • $n$ integers $0, 1, \ldots, n-1$ satisfying the condition. If there are multiple answers, print any of them.

Example

Input

2
10 2
2 3
6 1
2

Output

0 2 6 8 4 1 3 5 7 9
-1