CF1333A.Little Artem

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

Little Artem

Young boy Artem tries to paint a picture, and he asks his mother Medina to help him. Medina is very busy, that's why she asked for your help.

Artem wants to paint an n×mn \times m board. Each cell of the board should be colored in white or black.

Lets BB be the number of black cells that have at least one white neighbor adjacent by the side. Let WW be the number of white cells that have at least one black neighbor adjacent by the side. A coloring is called good if B=W+1B = W + 1.

The first coloring shown below has B=5B=5 and W=4W=4 (all cells have at least one neighbor with the opposite color). However, the second coloring is not good as it has B=4B=4, W=4W=4 (only the bottom right cell doesn't have a neighbor with the opposite color).

Please, help Medina to find any good coloring. It's guaranteed that under given constraints the solution always exists. If there are several solutions, output any of them.

Input

Each test contains multiple test cases.

The first line contains the number of test cases tt (1t201 \le t \le 20). Each of the next tt lines contains two integers n,mn, m (2n,m1002 \le n,m \le 100) — the number of rows and the number of columns in the grid.

Output

For each test case print nn lines, each of length mm, where ii-th line is the ii-th row of your colored matrix (cell labeled with 'B' means that the cell is black, and 'W' means white). Do not use quotes.

It's guaranteed that under given constraints the solution always exists.

Note

In the first testcase, B=3B=3, W=2W=2.

In the second testcase, B=5B=5, W=4W=4. You can see the coloring in the statement.

Samples

2
3 2
3 3
BW
WB
BB
BWB
BWW
BWB

在线编程 IDE

建议全屏模式获得最佳体验