F. Meta Sudoku
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output
Example
Input
2
1
12..
34..
..12
..3.
4
1..3
.22.
.22.
3..4
Output
3
24