#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  string s[n], clr = "BW";
  for (long long i = 0; i < n; ++i) cin >> s[i];
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < m; ++j) {
      if (s[i][j] == '.')
        cout << clr[(i + j) % 2];
      else
        cout << s[i][j];
    }
    cout << '\n';
  }
  return 0;
}
