#include <bits/stdc++.h>
char board[102][102];
int n, m;
int main() {
  int i, j, k;
  char s[110];
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%s", board[i]);
  }
  for (i = 1; i <= n; i++) {
    for (j = 0; j <= m; j++) {
      if (board[i][j] == '.') {
        if ((i % 2 && j % 2) || (i % 2 == 0 && j % 2 == 0)) {
          board[i][j] = 'W';
        } else {
          board[i][j] = 'B';
        }
      }
    }
    printf("%s\n", board[i]);
  }
  return 0;
}
