(function (f, w, h, c) h = tonumber(h) local s,t = f(w,c) for _=2,h,2 do io.write(s,"\n",t,"\n") end if h%2~=0 then io.write(s,"\n") end end)(function (w, c) w = tonumber(w) local t = c=="B" and "W" or "B" if w==1 then return c,t end local s = (c..t):rep(bit.rshift(w,1))..(w%2~=0 and c or "") return s,s:sub(2)..(w%2~=0 and t or c) end, io.stdin:read("*l"):match("(%w+)%s(%w+)%s(%w+)"))