#include <bits/stdc++.h>
using namespace std;
string arr[101];
int n, m;
void foo(int x, int y, bool c) {
  if (c)
    arr[x][y] = 'B';
  else
    arr[x][y] = 'W';
  if (x - 1 >= 0 && arr[x - 1][y] == '.') {
    foo(x - 1, y, !c);
  }
  if (y - 1 >= 0 && arr[x][y - 1] == '.') {
    foo(x, y - 1, !c);
  }
  if (x + 1 < n && arr[x + 1][y] == '.') {
    foo(x + 1, y, !c);
  }
  if (y + 1 < m && arr[x][y + 1] == '.') {
    foo(x, y + 1, !c);
  }
}
int main(int argc, char** argv) {
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (arr[i][j] == '.') foo(i, j, 0);
    }
  }
  for (int i = 0; i < n; i++) {
    cout << arr[i];
    cout << endl;
  }
  return 0;
}
