The civil war in the Bytelandian ocean has ended. The two Bytelandian islands have decided to unite forming the United Kingdom of Bytelandia. One of the first concerns of the newly chosen government is transportation.
Prior to the war each of the islands had a perfect network of transportation. On any given island, every city was connected by a train to every other city. Connections are bidirectional. During the war, some train lines were disrupted and thus, the trains on these lines were suspended. On any island, no more than trains were suspended. In addition to rerunning the disrupted trains, the government has to form inter-island ferry connections. The ferries will connect every city to every city , given that and are not on the same island. Commuting between cities on the same island will only be via trains.
In Bytelandia, everything is binary, including train and ferry ticket prices. A ticket costs either or units of currency. The government decided not to change any ticket prices for trains that were not disrupted during the war. It will assign ticket costs to the trains suspended during the war and to all ferry lines. Priding themselves in being strong mathematicians, Bytelandians have decided to design the ticket system such that for any distinct cities , and ,
where C(X, Y) is the ticket price of getting from to (by train if they belong to the same island or by ferry otherwise).
You are given a description of the Bytelandian islands, your goal is to figure out a costs assignment if it is possible.
Your program will be tested on one or more test cases. The first line of the input will be a single integer , the number of test cases (1 \le T \le 100). Followed by the test cases, each test case is the description of both islands (one after the other). The description of one island starts with one line containing one integer C_k represents the number of cities in this island, followed by C_k lines each one contains C_k characters (1 \le C_k \le 100). Each character is '', '' or ''. The th character of the th line is the price of the train ticket from city to city on that island. A price '' means that it is one of the suspended train lines. Each C_k by C_k table is guaranteed to be symmetric (table_{i,j} = table_{j,i} for each different and ), and each table will have a diagonal of ''s (table_{i,i} = '' for each different ), also each table will contain no more than ''s ( different trains, because each train will be mentioned twice in the table).
Note that the input might contain different cities in the same islands and the trains connecting them are not suspended, and these cities don't satisfy the described condition above.
For each test case, if there is no way to do the costs assignment satisfying the conditions described above, output on a single line NO (without the quotes). Otherwise, print YES (without the quotes) on the first line followed by C_1 + C_2 lines each one contains C_1 + C_2 characters (C_1 is the number of cities in the first island, and C_2 is the number of cities in the second island). The th character on the th line is the cost of getting from city to city (by train if they belong to the same island or by ferry otherwise). In the output, the cities on the first island are numbered from to C_1 (inclusive) while the cities in the second island are numbered from C_1 + 1 to C_1 + C_2 (inclusive). If there is more than one correct solution, print anyone of them.
Note that you can't change the costs given in the input, and the output table must be symmetric.
Example 1