#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = 0;
  cin >> n >> m;
  char a[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
    }
  }
  bool check = false;
  char c, d;
  for (int i = 0; i < n; i++) {
    if (i % 2 == 0) {
      c = 'B';
      d = 'W';
    } else {
      c = 'W';
      d = 'B';
    }
    for (int j = 0; j < m; j++) {
      if (j % 2 == 0) {
        if (a[i][j] == '.') {
          a[i][j] = c;
        }
      }
      if (j % 2 != 0) {
        if (a[i][j] == '.') {
          a[i][j] = d;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << a[i][j];
    }
    cout << endl;
  }
}
