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