#include <bits/stdc++.h>
using namespace std;
template <typename X>
inline X sqr(const X& a) {
  return a * a;
}
int nxt() {
  int x;
  cin >> x;
  return x;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void solve() {
  int n = nxt(), m = nxt();
  for (int i = 0; i < int(n); ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < int(m); ++j) {
      if (s[j] == '.') {
        s[j] = ((i + j) & 1 ? 'B' : 'W');
      }
    }
    cout << s << '\n';
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
