private void begin() {
		Scanner scn = new Scanner(System.in);
		int qTc = Integer.parseInt(scn.nextLine());
		for ( int tc = 1; tc <= qTc; tc++ ) {
			int dim = Integer.parseInt(scn.nextLine());
			char matrix[][] = new char[dim][];
			for ( int l = 0; l < dim; l++ ) {
				matrix[l] = new char[dim];
				String line = scn.nextLine();
				//System.out.println(line);
				for ( int c = 0; c < dim; c++ ) {
					matrix[l][c] = line.charAt(c);
				}
			}
			int qComm = Integer.parseInt(scn.nextLine());
			for ( int comm = 0; comm < qComm; comm++ ) {
				String command = scn.nextLine();
				if ( command.startsWith("transpose") ) {
					transpose( matrix );
				} else if ( command.startsWith("inc") ) {
					add(matrix, 1);
				} else if ( command.startsWith("dec") ) {
					add( matrix, -1);
				} else {
					StringTokenizer st = new StringTokenizer( command );
					st.nextToken();
					int a  = Integer.parseInt(st.nextToken());
					int b  = Integer.parseInt(st.nextToken());
					if ( command.startsWith("row") ) {
						row( matrix, a, b );
					} else {
						col( matrix, a, b );
					}
				}
					
			}
			System.out.println("Case #" + tc);
			printMatrix(matrix);
			System.out.println();
		}
	}