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