import Control.Applicative import Control.Monad import Data.List f w h c = take h $ (if c=="B" then id else tail) checker where checker = take w bwstr : take w (tail bwstr) : checker bwstr = 'B':'W':bwstr main = words <$> getLine >>= \[w, h, c] -> mapM_ putStrLn $ f (read w) (read h) c