#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  bool ch = false, ch1 = false;
  cin >> n >> m;
  string *k = new string[n], *h = new string[n];
  for (int i = 0; i < n; i++) {
    cin >> k[i];
    for (int j = 0; j < m; j++) {
      (j == 0) ? ch1 = ch : ch = ch;
      if (k[i][j] == '.') {
        if (ch == false)
          h[i] += 'B';
        else
          h[i] += 'W';
      } else
        h[i] += '-';
      (ch == false) ? ch = true : ch = false;
    }
    (ch1 == false) ? ch = true : ch = false;
  }
  for (int i = 0; i < n; i++) cout << h[i] << endl;
  return 0;
}
