#include <bits/stdc++.h>
using namespace std;
double _st;
const long long mod = 1000000007;
const long long inf = 1e12;
const int N = 123456;
int ans[101][101];
string a[101];
void solve() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < (n); i++) cin >> a[i];
  int c = 0;
  for (int i = 0; i < (m); i++) {
    ans[0][i] = c % 2;
    c++;
  }
  for (int i = (1); i < (n); ++i)
    for (int j = 0; j < (m); j++) {
      ans[i][j] = 1 - ans[i - 1][j];
    }
  for (int i = 0; i < (n); i++) {
    for (int j = 0; j < (m); j++) {
      if (a[i][j] == '-')
        cout << '-';
      else {
        if (ans[i][j] == 0)
          cout << 'W';
        else
          cout << 'B';
      }
    }
    cout << endl;
  }
}
void pre() {
  { solve(); }
}
void end() {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  pre();
  end();
  return 0;
}
