import Data.List ( group ) main :: IO () main = interact $ solve . init solve :: String -> String solve s = f $ dropWhile (\(a, b) -> a >= 3) v where t = group s u = map length t v = zip u t f :: [(Int, String)] -> String f [] = "NA" f (x:xs) = if (head (snd x)) == 'O' then "East" else "West"