import Control.Monad main :: IO () main = do l <- words <$> getLine :: IO [String] let (w,h,c) = let [l1,l2,l3] = l in (read l1, read l2, head l3) :: (Int,Int,Char) let x = if c == 'B' then 1 else 0 forM_ [1..h] $ \i -> do forM_ [1..w] $ \j -> do putChar $ if (i+j) `rem` 2 == x then 'W' else 'B' putStrLn ""