Codeforces Round 254 (Div. 2)
A
DZY Loves Chessboard
Codeforces
1200
原题
←B →
翻译中…

DZY loves chessboard, and he enjoys playing with it.

翻译中…

He has a chessboard of $*n*$ rows and $*m*$ columns. Some cells of the chessboard are bad, others are good. For every good cell, DZY wants to put a chessman on it. Each chessman is either white or black. After putting all chessmen, DZY wants that no two chessmen with the same color are on two adjacent cells. Two cells are adjacent if and only if they share a common edge.

翻译中…

You task is to find any suitable placement of chessmen on the given chessboard.

翻译中…

Input

翻译中…

The first line contains two space-separated integers $*n*$ and $*m*$ $(1 ≤ *n*, *m* ≤ 100)$.

翻译中…

Each of the next $*n*$ lines contains a string of $*m*$ characters: the $*j*$-th character of the $*i*$-th string is either "." or "-". A "." means that the corresponding cell (in the $*i*$-th row and the $*j*$-th column) is good, while a "-" means it is bad.

翻译中…

Output

翻译中…

Output must contain $*n*$ lines, each line must contain a string of $*m*$ characters. The $*j*$-th character of the $*i*$-th string should be either "W", "B" or "-". Character "W" means the chessman on the cell is white, "B" means it is black, "-" means the cell is a bad cell.

翻译中…

If multiple answers exist, print any of them. It is guaranteed that at least one answer exists.

翻译中…

Note

翻译中…

In the first sample, DZY puts a single black chessman. Of course putting a white one is also OK.

翻译中…

In the second sample, all $4$ cells are good. No two same chessmen share an edge in the sample output.

翻译中…

In the third sample, no good cells are adjacent. So you can just put $3$ chessmen, no matter what their colors are.

翻译中…

样例

Input #1
1 1
.
Output #1
B
InputCopy OutputCopy
Input #2
2 2
..
..
Output #2
BW
WB
InputCopy OutputCopy
Input #3
3 3
.-.
---
--.
Output #3
B-B
---
--B
InputCopy OutputCopy
题目信息
题号
445A
时间限制
1 s
内存限制
256 MB
标签
DFS 及类似
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。