class A def initialize w, h, c = gets.chomp.split(' ') o = (c == 'W')? 'B' : 'W' w = w.to_i h = h.to_i even_str = ((c+o) * w).slice(0,w) odd_str = ((o+c) * w).slice(0,w) h.times do |i| puts (i.even?)? even_str : odd_str end end end A.new