import Data.List ( group ) main :: IO () main = do s <- getLine let t = dropWhile (<= 3) $ map length $ group s u = zip (map length $ group s) (group s) if null t then putStrLn "NA" else putStrLn $ f u where f :: [(Int, String)] -> String f (x:_) = if elem 'O' (snd x) then "East" else "West"