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