#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
char c[MAXN][MAXN];
int n, m;
void dfs(int x, int y, char color) {
  if (c[x][y] != '.' || (x < 1 || x > n || y < 1 || y > m)) return;
  c[x][y] = color;
  char fill;
  if (color == 'W')
    fill = 'B';
  else
    fill = 'W';
  dfs(x, y - 1, fill);
  dfs(x, y + 1, fill);
  dfs(x - 1, y, fill);
  dfs(x + 1, y, fill);
}
int main() {
  c[1][1] = 'B';
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> c[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (c[i][j] == '.') {
        dfs(i, j, 'B');
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cout << c[i][j];
    }
    cout << endl;
  }
  return 0;
}
