-- yukicoder My Practice -- author: Leonardone @ NEETSDKASU w = io.stdin:read("*n") h = io.stdin:read("*n") c = io.read():match('%S') if c == 'B' then d = 'W' else d = 'B' end s = '' for i = 1, h do if i > 1 then s = s .. "\n" end if i % 2 == 0 then k = 1 else k = 0 end for j = 1, w do if k == 0 then s = s .. c else s = s .. d end k = 1 - k end end print(s)