#include <bits/stdc++.h>
using namespace std;
int main() {
  int r, l;
  cin >> r >> l;
  char map[105][105];
  for (int a = 1; a <= r; a++)
    for (int b = 1; b <= l; b++) {
      cin >> map[a][b];
      if ((a + b) % 2 == 0 && map[a][b] == '.') map[a][b] = 'B';
      if ((a + b) % 2 != 0 && map[a][b] == '.') map[a][b] = 'W';
    }
  for (int a = 1; a <= r; a++)
    for (int b = 1; b <= l; b++) {
      cout << map[a][b];
      if (b == l) cout << endl;
    }
  return 0;
}
