class Program { static void Main(string[] args) { string input = Console.ReadLine()!; int oCount = 0; int xCount = 0; foreach (char c in input) { if (c == 'O') { oCount++; if (oCount == 3) { Console.WriteLine("East"); return; } xCount = 0; } else { xCount++; if (xCount == 3) { Console.WriteLine("West"); return; } oCount = 0; } } Console.WriteLine("NA"); } }