Fashion Show#8694

Fashion Show

1 second
128 megabytes
Easy

You are about to host a fashion show to show off three new styles of clothing. The show will be held on a stage which is in the most fashionable of all shapes: an -by- grid of cells.

Each cell in the grid can be empty (which we represent with a . character) or can contain one fashion model. The models come in three types, depending on the clothing style they are wearing: +, x and the super-trendy o. A cell with a + or x model in it adds style point to the show. A cell with an o model in it adds style points. Empty cells add no style points.

To achieve the maximum artistic effect, there are rules on how models can be placed relative to each other.

Formally, a model located in row i_0 and column j_0 and a model located in row i_1 and column j_1 share a row if and only if i_0 = i_1, they share a column if and only if j_0 = j_1, and they share a diagonal if and only if i_0 + j_0 = i_1 + j_1 or i_0 - j_0 = i_1 - j_1.

For example, the following grid is not legal:

...

x+o

.+.

The middle row has a pair of models (x and o) that does not include a +. The diagonal starting at the + in the bottom row and running up to the o in the middle row has two models, and neither of them is an x.

However, the following grid is legal. No row, column, or diagonal violates the rules.

+.x

+x+

o..

Your artistic advisor has already placed models in certain cells, following these rules. You are free to place any number (including zero) of additional models of whichever types you like. You may not remove existing models, but you may upgrade as many existing + and x models into o models as you wish, as long as the above rules are not violated.

Your task is to find a legal way of placing and / or upgrading models that earns the maximum possible number of style points.

Input

The first line gives the number of test cases (1 \le t \le 100). test cases follow. Each test case begins with one line with two integers (1 \le n \le 100) and (0 \le m \le n^2) as described above. Then more lines follow; the -th of these lines has a +, x or o character (the type of the model) and two integers r_i and c_i (the position of the model). The rows of the grid are numbered through from top to bottom. The columns of the grid are numbered through from left to right.

Output

For each test case, first output one line containing Case #x: y z, where is the test case number (starting from ), is the number of style points earned in your arrangement, and is the total number of models you have added and/or substituted in. Then, for each model that you have added or substituted in, output exactly one line in exactly the same format described in the Input section, where the character is the type of the model that you have added or substituted in. These lines can be in any order.

If there are multiple valid answers, you may output any one of them.

Examples

Example 1

Loading
Loading