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