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