#include <bits/stdc++.h>
using namespace std;
const int inf = (int)(1e9);
const int mod = inf + 7;
const double pi = acos(-1.0);
const double eps = 1e-9;
double ans = 0.0;
int a, b, c, n, m;
char x;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> x;
      if (x == '.') {
        if ((i + j) % 2 == 1)
          cout << 'W';
        else
          cout << "B";
      } else
        cout << x;
    }
    cout << endl;
  }
}
