#include <bits/stdc++.h>
using namespace std;
string x;
int n, m, ww = 0, bw = 0;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    ww = 1 - ww;
    if (ww == 1)
      bw = 1;
    else
      bw = 0;
    cin >> x;
    for (int j = 0; j < m; j++) {
      if (x[j] == '.' && bw == 1)
        cout << "B";
      else if (x[j] == '.' && bw == 0)
        cout << "W";
      else
        cout << "-";
      bw = 1 - bw;
    }
    cout << endl;
  }
  return 0;
}
