import java.util.*; class No0082{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); String c = sc.next(); String d; String temp = ""; System.out.print(c); d = c; if(w != 1 && h != 1){ for(int i = 0; i < h; i++){ for(int j = 0; j < w; j++){ if(d.equals("B")){ System.out.print("W"); d = "W"; }else{ System.out.print("B"); d = "B"; } if(j + 1 == w){ temp = d; } if(i == 0 && j + 2 == w){ temp = d; break; } } System.out.println(); if(w % 2 == 0){ if(temp == "B"){ d = "W"; }else{ d = "B"; } } } } } }