Atlansert encountered a leak, and the Z-tube Cat said there were stories hidden there.
Given a positive integer $$$n$$$ and two permutations $$$^{\text{*}}$$$ $$$r,c$$$ of length $$$n$$$.
Find a matrix satisfying all the following conditions:
It can be proved that such a matrix exists.
$$$^{\text{*}}$$$ A permutation of length $$$n$$$ is an array consisting of $$$n$$$ distinct integers from $$$1$$$ to $$$n$$$ in an arbitrary order. For example, $$$[2,3,1,5,4]$$$ is a permutation of length 5, but $$$[1,2,2]$$$ is not a permutation($$$2$$$ appears twice in the array) and $$$[1,3,4]$$$ is also not a permutation($$$n=3$$$ but there is $$$4$$$ in the array).
$$$^{\text{†}}$$$ The MEX (minimum excluded) of an array is the smallest non-negative integer that does not belong to the array. For instance:
Each test contains multiple test cases. The first line contains an integer $$$T(1 \le T \le 10^3)$$$, indicating the number of test cases.
For each test case:
The first line gives a positive integer $$$n(1\le n\le2\times 10^3)$$$.
The second line provides a permutation of length $$$n$$$: $$$r_1, r_2, \ldots, r_n$$$.
The third line provides another permutation of length $$$n$$$: $$$c_1, c_2, \ldots, c_n$$$.
It is guaranteed that the sum of all $$$n$$$ values across all test cases does not exceed $$$2 \times 10^3$$$.
For each test case, output $$$n$$$ lines, each containing $$$n$$$ integers representing a matrix that satisfies all conditions of this problem. If multiple such matrices exist, output any one of them.
2 4 2 1 3 4 3 4 1 2 5 2 1 4 3 5 1 4 2 5 3
0 0 4 1 2 3 4 0 1 2 0 1 0 1 2 3 0 0 0 0 1 0 0 0 2 0 2 3 3 1 0 2 1 0 4 2 0 2 1 3 4