#include <bits/stdc++.h>
using namespace std;
int n, m;
char c[109][109];
bool ja = 1;
bool useless = 1;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> c[i][j];
      if (c[i][j] == '.') {
        if (i % 2 == 0 && j % 2 == 0 || i % 2 == 1 && j % 2 == 1) {
          c[i][j] = 'B';
        } else {
          c[i][j] = 'W';
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << c[i][j];
    }
    cout << endl;
  }
  return 0;
}
