#include <bits/stdc++.h>
using namespace std;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
const long double PI = 3.1415926535897932384626;
const long long int MAX = 1000000000 + 7;
char s[105][105];
int main() {
  long long int n, m;
  scanf("%lld", &n);
  scanf("%lld", &m);
  for (long long int i = 0; i <= n; i++) s[i][0] = '-';
  for (long long int j = 0; j <= m; j++) s[0][j] = '-';
  char x;
  scanf("%c", &x);
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= m; j++) {
      scanf("%c", &s[i][j]);
    }
    scanf("%c", &x);
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= m; j++) {
      if (s[i][j] == '.') {
        if (i % 2 == 1 and j % 2 == 1)
          s[i][j] = 'B';
        else if (i % 2 == 1 and (j % 2 == 0))
          s[i][j] = 'W';
        else if ((i % 2 == 0) and j % 2 == 1)
          s[i][j] = 'W';
        else if ((i % 2 == 0) and (j % 2 == 0))
          s[i][j] = 'B';
      }
    }
  }
  for (long long int i = 1; i <= n; i++) {
    for (long long int j = 1; j <= m; j++) printf("%c", s[i][j]);
    printf("\n");
  }
  return 0;
}
