import java.util.Scanner; public class Main{ public static void main(String args[])throws Exception{ Scanner sc = new Scanner(System.in); int W = sc.nextInt(); int H = sc.nextInt(); String c = sc.next(); char C = c.charAt(0); char notC = (char) ('B' + 'W' - C); for(int i=0;i