W, H, C = gets.chomp.split width = W.to_i height = H.to_i # 1行H文字の文字列をW行分出力する row = 0 count = 0 height.times do row = row + 1 width.times do count = count + 1 # もしCが"B"且つ奇数行ならBから始まり、そうでなければWから始まる if C == "B" && row % 2 == 1 if count % 2 == 1 str1 = "B" else str1 = "W" end print str1 else if count % 2 == 1 str2 = "W" else str2 = "B" end print str2 end end print "\n" end