import Control.Monad rInt :: String -> Int rInt = read rcTuple [rc,x] = (rc, rInt x) solve _ _ [] x y | ((x + y) `mod` 2) == 0 = "white" | otherwise = "black" solve w h (rc:rcs) x y | updateX = solve w h rcs x' y | updateY = solve w h rcs x y' | otherwise = solve w h rcs x y where updateX = (fst rc) == "R" && (snd rc) == y updateY = (fst rc) == "C" && (snd rc) == x x' | (x - 1) < 0 = w - 1 | otherwise = x - 1 y' | (y - 1) < 0 = h - 1 | otherwise = y - 1 main = do [h, w] <- map rInt . words <$> getLine n <- readLn rc <- map (rcTuple . words) <$> replicateM n getLine putStrLn $ solve w h rc 0 0