let bw = [|'B'; 'W'|]

let () =
  let w, h, c = Scanf.scanf "%d %d %c " (fun w h c -> w, h, c) in
  let z = if c = 'B' then 0 else 1 in
  let rec doit j x =
    if j = w then ()
    else begin
      print_char bw.(x);
      doit (j + 1) ((x + 1) mod 2)
    end in
  for i = 1 to h do
    doit 0 ((z + i - 1) mod 2);
    print_newline ()
  done