The input starts with a line containing a number $T$ which indicates the number of test cases. Each test case starts with a line containing two numbers $n$ (2 ≤ $n$ ≤ 2000) and $m$ (1 ≤ $m$ ≤ 2000) which indicate the number of jewels and colors respectively. Then n lines follow and each contains m numbers indicating $a_{i,j}$ (1 ≤ $a_{i,j}$ ≤ 1000000)
For each test case, please print only one line in the form of “Case $x$: $ans$”, where $x$ is the test number and $ans$ indicates the answer. If it is impossible for Alice to find a valid arrangement, the answer is -1.
2
4 2
1 2
2 1
1 1
2 2
4 3
8 3 7
2 6 7
2 7 3
5 6 3
The following picture is the illustration of the samples, in which numbers and shapes indicate indexes of jewels and their colors separately.
In the first sample, we use the first color to color the jewels with indexes 1 and 3, and color the others with the second color.
In the second sample, we use the second color to color the jewel with index 1, the first color to color the jewels with indexes 2 and 3, and the third one to color the jewel with index 4.
The orders of jewels are illustrated below.