W, H, C = gets.chomp.split width = W.to_i # H行分出力する H.to_i.times do |i| case C when "B" then str = (i + 1).odd? ? "BW" : "WB" when "W" then str = (i + 1).odd? ? "WB" : "BW" end puts (str * width)[0, width] end