w, h, c = gets.split w = w.to_i h = h.to_i d = "BW".tr(c, "") e = c + d l1 = w.even? ? e * (w / 2) : e * (w /2) + c l2 = l1[1..] + l1[-1].tr("BW", "WB") a, b = h.divmod(2) a.times do |i| puts l1 puts l2 end b.times do |j| puts l1 end