#include <bits/stdc++.h>
using namespace std;
int n, m;
char grid[105][105];
int main() {
  bool x;
  string t;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    if (i % 2 != 0) {
      x = false;
    } else {
      x = true;
    }
    cin >> t;
    for (int j = 0; j < m; j++) {
      if (t[j] == '.' && x == true) {
        grid[i][j] = 'B';
        x = false;
      } else if (t[j] == '.' && x == false) {
        grid[i][j] = 'W';
        x = true;
      } else {
        grid[i][j] = '-';
        if (x == true) {
          x = false;
        } else {
          x = true;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cout << grid[i][j];
    }
    cout << endl;
  }
}
