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