import Control.Applicative ((<$>)) main :: IO () main = do solve <$> getLine >>= putStrLn solve :: String -> String solve (x:y:z:zs) | x == y && y == z = if x == 'O' then "East" else "West" | otherwise = solve (y:z:zs) solve _ = "NA"