Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 625$). The description of the test cases follows.

The first line of each test case contains a single integer $n$~--- the number of rows and columns in the grid ($2 \le n \le 50$).

The $i$-th of the following $n$ lines contains $n$ integers $c_{i, 1}, c_{i, 2}, \ldots, c_{i, n}$ ($0 \le c_{i, j} < 2^{24}$). The RGB color of cell $(i, j)$ is $c_{i, j}$.

It is guaranteed that the sum of $n^2$ over all test cases does not exceed $2500$.