The first line is T (T <= 50), the number of test cases.
For each case, the first line containing 2 integers: N, M (0 < N <= 100 and 0 < M <= 10). Then 2N - 1 lines followed, describing the lamps and the wires between them. Each line is a street with m lamps, 'o' represent a lit lamp while '*' represent a lamp that already be turned off, '|' and '-' represent a wire that connecting two neighboring lamps. And the '\' ,'/' indicates a wire sideling connecting. And 'X' indicates two wires sideling connecting. For more details, please read the hint for test case.