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