I. Domino Swap
time limit per test
4 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

There is an $$$n$$$ by $$$m$$$ grid of black and white squares. In one operation, you can pick any two adjacent squares of the same color and swap the colors of both. For example, here is a valid sequence of two operations on a grid with $$$n=4$$$, $$$m=3$$$:

You are also given a target grid of $$$n$$$ by $$$m$$$ black and white squares. Perform at most $$$200nm$$$ operations on the starting grid to reach the target grid, or state that it is impossible to do so. You do not need to minimize the number of operations.

It can be shown that if there is a solution, there is one that uses at most $$$200nm$$$ operations.

Input

The first line of the input contains a single integer $$$t$$$ ($$$1 \le t \le 500$$$) — the number of test cases. The description of the test cases follows.

The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 50$$$) — the number of rows and columns in the grid, respectively.

The $$$i$$$-th of the next $$$n$$$ lines contains $$$m$$$ characters describing the $$$i$$$-th row of the starting grid. The $$$j$$$-th of these is '#' if the square at position $$$(i, j)$$$ is black, and '.' if the square at position $$$(i, j)$$$ is white.

The next $$$n$$$ lines describe the target grid in the same format as the starting grid.

It is guaranteed that the sum of $$$n\cdot m$$$ over all test cases does not exceed $$$2500$$$.

Output

For each test case, if there is no solution, output a single integer $$$-1$$$.

Otherwise, the first line of output for each test case should contain a single integer $$$k$$$ ($$$0 \le k \le 200nm$$$) — the number of operations you will perform.

The next $$$k$$$ lines of output should each contain four integers $$$i_1$$$, $$$j_1$$$, $$$i_2$$$, and $$$j_2$$$ ($$$1 \le i_1, i_2 \le n$$$, $$$1 \le j_1, j_2 \le m$$$) — the two adjacent squares $$$(i_1, j_1)$$$ and $$$(i_2, j_2)$$$ that are part of this operation.

If there are multiple solutions, print any.

Example
Input
6
3 3
..#
.#.
.#.
#.#
..#
.##
4 6
#.#.#.
.#.#.#
#.#.#.
.#.#.#
......
......
......
......
1 1
#
#
4 5
#...#
...#.
###.#
....#
..#.#
.#...
###.#
.##.#
1 8
...#....
........
4 2
..
..
..
..
##
##
##
##
Output
3
1 1 1 2
1 2 2 2
2 3 3 3
-1
0
5
1 2 1 3
2 2 2 3
1 1 1 2
2 3 2 4
4 2 4 3
-1
4
1 1 1 2
4 1 4 2
2 1 3 1
2 2 3 2
Note

Here is the sequence of $$$3$$$ operations described by the output of the first test case:

It is impossible to perform any operations in the second test case, so it is not possible to reach the target grid.