There is a wall consisting of n \times n tiles. Long ago, those tiles were painted in different colors. Now the paint has worn out, and the wall must be repainted. This time, all the tiles of the wall should be painted in just one of the colors. In one move, we can paint one horizontal or one vertical row of tiles. Also, we can paint a row in a given color only if at least two tiles in this row (horizontal or vertical) are already in this color (either from the old or new paint). You need to determine the minimal number of moves needed to paint all tiles.
The first line of input contains the number of test cases.
The first line of each test case contains two integers: (1 < n \leq 500) --- the number of tiles in one row, and (1 \leq k < n) --- the number of different colors available.
In each of the following lines, there are natural numbers giving the numbers of the colors in which the corresponding tile was painted before. The colors are numbered from to .
The first line of the output for each test case should contain the number --- the minimal number of moves needed to paint all the tiles.
In the second line, list the numbers of all the colors in which we can paint the wall according to the given rules with the same number of moves. The numbers should be listed in increasing order.
If it is impossible to paint all the tiles following the rules in the statement, then print just the number .
\begin{example}\exmp{23 21 2 21 1 12 2 12 11 22 2}{21 20}\end{example}
Example 1