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