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