#include <bits/stdc++.h>
using namespace std;
const int MAXN = 101;
char mat[MAXN][MAXN];
int n, m;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
struct Node {
  int x, y;
  int flag;
};
bool can_move(int i, int j) {
  if (i >= 0 && i < n && j >= 0 && j < m && mat[i][j] == '.') return true;
  return false;
}
void bfs(int i, int j) {
  Node q[MAXN * MAXN * 10];
  int front = 0, rear = 0;
  q[rear].x = i;
  q[rear].y = j;
  mat[i][j] = 'B';
  q[rear++].flag = false;
  while (front < rear) {
    Node now = q[front++];
    bool flag = now.flag;
    for (int i = 0; i < 4; i++) {
      if (can_move(now.x + dx[i], now.y + dy[i])) {
        if (flag) {
          mat[now.x + dx[i]][now.y + dy[i]] = 'B';
          Node tmp;
          tmp.x = now.x + dx[i];
          tmp.y = now.y + dy[i];
          tmp.flag = !flag;
          q[rear++] = tmp;
        } else {
          mat[now.x + dx[i]][now.y + dy[i]] = 'W';
          Node tmp;
          tmp.x = now.x + dx[i];
          tmp.y = now.y + dy[i];
          tmp.flag = !flag;
          q[rear++] = tmp;
        }
      }
    }
  }
}
int main() {
  while (scanf("%d%d", &n, &m) == 2) {
    for (int i = 0; i < n; i++) scanf("%s", mat[i]);
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++)
        if (mat[i][j] == '.') bfs(i, j);
    for (int i = 0; i < n; i++) cout << mat[i] << endl;
  }
  return 0;
}
