#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  char tmp;
  cin >> n >> m;
  auto color = [](bool c) { return c ? 'W' : 'B'; };
  bool c;
  for (int i = 0; i < n; i++) {
    c = i % 2;
    for (int j = 0; j < m; j++) {
      cin >> tmp;
      if (tmp == '.') {
        cout << color(c);
      } else
        cout << tmp;
      c = !c;
    }
    cout << "\n";
  }
  return 0;
}
