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