#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, j, k, l, a, v, b, n, m;
  string s;
  while (cin >> n >> m) {
    for (l = 1; l <= n; l++) {
      cin >> s;
      for (i = 0; i < s.size(); i++) {
        if (l % 2 == 1) {
          if (s[i] == '-')
            cout << "-";
          else if (s[i] == '.') {
            if (i % 2 == 0)
              cout << "B";
            else if (i % 2 == 1)
              cout << "W";
          }
        } else if (l % 2 == 0) {
          if (s[i] == '-')
            cout << "-";
          else if (s[i] == '.') {
            if (i % 2 == 0)
              cout << "W";
            else if (i % 2 == 1)
              cout << "B";
          }
        }
      }
      cout << endl;
    }
  }
}
