#include <cstdio>
using namespace std;
int n, m;
char S[1100];
int main() {
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%s", S);
for (int j = 0; j < m; j++)
if (S[j] == '.') {
if ((i + j) & 1) S[j] = 'W';
else S[j] = 'B';
}
printf("%s\n", S);
}
}
I2luY2x1ZGUgPGNzdGRpbz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBuLCBtOwpjaGFyIFNbMTEwMF07CgppbnQgbWFpbigpIHsKCXNjYW5mKCIlZCVkIiwgJm4sICZtKTsKCWZvciAoaW50IGkgPSAwOyBpIDwgbjsgaSsrKSB7CgkJc2NhbmYoIiVzIiwgUyk7CgkJZm9yIChpbnQgaiA9IDA7IGogPCBtOyBqKyspCgkJCWlmIChTW2pdID09ICcuJykgewoJCQkJaWYgKChpICsgaikgJiAxKQlTW2pdID0gJ1cnOwoJCQkJZWxzZQlTW2pdID0gJ0InOwoJCQl9CgkJcHJpbnRmKCIlc1xuIiwgUyk7Cgl9Cn0K