Multiple test cases.
The first line contains an integer $T (T \leq 100)$, indicates the number of test cases.
For each test case, the first line contains a single integer $n (n \leq 1000)$, the number of lines of chessboard.
Then $n$ lines, the first integer of ith line is $m (m \leq 20)$, indicates the number of chesses on the ith line of the chessboard. Then m integers $p_{j} (1 \leq p_{j} \leq 20)$ followed, the position of each chess.