I. Matrix Reconstruction
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Deep within the ruins, you need to reconstruct a square energy matrix of size $$$n \times n$$$.

You have exactly $$$n^2$$$ energy crystals, with energy levels ranging from 1 to $$$n^2$$$. You must place all $$$n^2$$$ crystals into the matrix, such that each cell contains exactly one crystal.

To prevent dangerous resonance explosions between the crystals, an ancient rule states: The absolute difference in energy levels between any two adjacent crystals (sharing an edge, either horizontally or vertically) must be strictly greater than 1.

Formally, for any two adjacent elements $$$x$$$ and $$$y$$$ in the matrix, $$$|x - y| \gt 1$$$ must hold.

Please construct a valid placement for the matrix. If no such placement exists, output -1.

Input

The first line contains a single integer $$$t$$$ (1 $$$\le t \le$$$ 100) — the number of test cases.

For each test case, the only line contains a single integer $$$n$$$ (1 $$$\le n \le$$$ 100) — the size of the matrix.

Output

For each test case:

  • If it is impossible to construct a valid matrix, output -1 on a single line.
  • Otherwise, output $$$n$$$ lines, each containing $$$n$$$ integers separated by a space, representing your constructed matrix. If there are multiple valid solutions, you may output any of them.
Example
Input
3
1
2
3
Output
1
-1
1 8 6
4 2 9
7 5 3