import Data.List main = do [w,h,c] <- words <$> getLine let ichimatsu = tails $ dropWhile (/= head c) (cycle "BW") mapM_ putStrLn $ take (read h) (map (take (read w)) ichimatsu)