#include <bits/stdc++.h>
using namespace std;
int main() {
  int rows, cols;
  char c;
  char piece = 'B';
  char first;
  cin >> cols >> rows;
  for (int i = 0; i < cols; i++) {
    for (int j = 0; j < rows; j++) {
      cin >> c;
      if (c == '.') {
        cout << piece;
      } else if (c == '-') {
        cout << '-';
      }
      if (j == 0) first = piece;
      piece = (piece == 'B' ? 'W' : 'B');
    }
    cout << "\n";
    piece = (first == 'B' ? 'W' : 'B');
  }
}
