class Calc0082 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @w, @h, @c = args.shift @w, @h = [@w, @h].map(&:to_i) end def run @h.times.map { |h| @w.times.map { |w| ((w + h).even? ^ (@c == 'B')) ? 'W' : 'B' }.join }.join("\n") end end puts Calc0082.new(STDIN.readlines).run if __FILE__ == $0