-- 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 % 2 == 0 then k = 1 else k = 0 end for j = 1, w do if k == 0 then s = string.format('%s%s', s, c) else s = string.format('%s%s', s, d) end k = 1 - k end s = string.format("%s\n", s) end print(s)