#include <bits/stdc++.h>
using namespace std;
void solve(vector<string> a, int n, int m) {
  bool flag;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0)
      flag = true;
    else
      flag = false;
    for (int j = 0; j < m; j++) {
      if (a[i][j] == '.') {
        if (flag)
          printf("B");
        else
          printf("W");
      } else
        cout << a[i][j];
      flag = flag ^ true;
    }
    cout << "\n";
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  solve(a, n, m);
  return 0;
}
