Sudoku is a popular single player game. The objective is to fill a matrix with digits so that each column, each row, and all non-overlapping sub-matrices contain all of the digits from through . Each matrix is partially completed at the start of game play and typically has a unique solution.
:::align{center}
:::
Given a completed Sudoku matrix, your task is to determine whether it is a valid solution. A valid solution must satisfy the following criteria:
Each row contains each number from to , once each.
Each column contains each number from to , once each.
Divide the matrix into non-overlapping sub-matrices. Each sub-matrix contains each number from to , once each.
You don't need to worry about the uniqueness of the problem. Just check if the given matrix is a valid solution.
输入格式
The first line of the input gives the number of test cases, . test cases follow. Each test case starts with an integer . The next lines describe a completed Sudoku solution, with each line contains exactly integers. All input integers are positive and less than .
输出格式
For each test case, output one line containing "Case #x: y", where x is the case number (starting from ) and y is "Yes" (quotes for clarity only) if it is a valid solution, or "No" (quotes for clarity only) if it is invalid. Note that the judge is case-sensitive, so answers of "yes" and "no" will not be accepted.