// name: queens
import java.io.*;

public class QueensTemplate {
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    static class TestCase {
        int rows;
        int cols;
        String[][] board;
    }
    
    public static TestCase read() throws java.lang.Exception {
        TestCase testCase = new TestCase();
        String[] info = br.readLine().split("x");
        testCase.rows = Integer.parseInt(info[0]);
        testCase.cols = Integer.parseInt(info[1]);
        testCase.board = new String[testCase.rows][testCase.cols];
        for (int r = 0; r < testCase.rows; r++) {
            String[] row = br.readLine().split("");
            testCase.board[r] = row;
        }
        return testCase;
    }

    public static void logic(TestCase testCase) {
        // rows: A positive integer denoting the number of rows in the chessboard
        // cols: A positive integer denoting the number of columns in the chessboard
        // board: A 2-D array of strings representing the chessboard 
        // board[0][0] will give you the top left character of the chessboard, and 
        // board[2][0] will give you the character two rows down and to the very left
        int rows = testCase.rows;
        int cols = testCase.cols;
        String[][] board = testCase.board;

        // TODO: YOUR CODE HERE

        return;
    }

	public static void main(String[] args) throws java.lang.Exception {
        int T = Integer.parseInt(br.readLine());
        for (int i = 0; i < T; i++) {
            logic(read());
            br.readLine(); // Remember the blank line in between test cases!
        }
    }
}