D. YEET!
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Given two integers $$$n$$$ and $$$m$$$, find any permutation of length $$$n$$$ such that the following conditions hold. $$$$$$ \begin{cases} \gcd(p_i,p_{i+1}) \neq m \ (1 \le i \le n-1) \\ (p_i+p_{i+1}) \mod m \neq 0 \ (1 \le i \le n-1) \\ \end{cases} $$$$$$

Input

The first line contains the integer $$$t$$$ ($$$1 \le t \le 10^5)$$$  — the number of test cases.

For each test case:

  • The only line contains two integers $$$n,m$$$ ($$$2 \le n,m \le 5 \cdot 10^5$$$).

It's guaranteed that the sum of $$$n+m$$$ overall test cases doesn't exceed $$$ 10^6$$$.

Output

For each test case, if there is no such permutation, print $$$-1$$$. Otherwise, print any valid permutation that satisfies the condition.

Example
Input
3
4 4
5 7
9 7
Output
1 2 3 4
1 3 2 4 5
1 8 3 2 9 4 5 6 7