import Control.Applicative ((<$>)) import Control.Monad import Data.List main :: IO () main = do solve <$> getl words >>= mapM_ putStrLn solve :: [String] -> [String] solve [sw, sh, sp] = take (read sh) $ cycle [l1, l2] where l1 = take (read sw) $ if sp == "B" then cycle "BW" else cycle "WB" l2 = take (read sw) $ if sp == "B" then cycle "WB" else cycle "BW" getl :: (String -> a) -> IO a getl f = f <$> getLine