$\space \space$*How many times have you died in WarCraft because of falling off the UnderCity's elevator?*
$\space \space $*How many times have you traveled through the labyrinthine city but couldn't find the auction house?*
$\space \space$*Undercity is a maze itself!*
Undercity's map can be seen as an $n \cdot m$ matrix, each cell of the matrix contains a lowercase English letter. A path is a sequence of cells such that two neighbouring cells share one edge and the next cell can be reached from the previous cell by only moving **right or down**.
The city is a little bit weird, so one can only travel through a palindromic path.
A palindromic path is a path such that if you view the letters on all the cells from the starting point to the ending point of the path as a sequence, the sequence is equal when you read from left to right and from right to left.
A way of covering is considered magic if and only if all cells of the matrix are covered by **exactly one** palindromic path.
Two magic coverings are considered different if and only if there is **at least one** cell that is covered by different paths in two ways.
Sylvanas believes it's a fulfilling mission to find the number of magic coverings in the city.
Let's help her to do it!
输入解释
The input consists of multiple test cases.
The first line contains an integer $T\ (1\leq T\leq10)$ denoting the number of test cases.
In each test case, the first line contains two integers $n, m(n,m\leq 6)$, denoting the size of matrix.
The following $n$ lines, each line contains $m$ lowercase English letters, describing the matrix.
输出解释
For each test case, output one line containing one integer, denoting the answer.