#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  string s;
  for (long long i = 0; i < n; i++) {
    cin >> s;
    for (long long j = 0; j < m; j++) {
      if (s[j] == '.') {
        if (i % 2 == j % 2) {
          s[j] = 'W';
        } else {
          s[j] = 'B';
        }
      }
    }
    cout << s << endl;
  }
  return 0;
}
