public class Program { public static void Main() { //int num = int.Parse(Console.ReadLine() ?? string.Empty); //string[] str = (Console.ReadLine() ?? string.Empty).Trim().Split(' '); string str = Console.ReadLine() ?? string.Empty; int indexo = str.IndexOf("OOO"); int indexx = str.IndexOf("XXX"); //西が先に三連勝 if(indexx < indexo && indexx != -1 || indexo == -1 && indexx >=0) { Console.WriteLine("West"); } else if(indexo < indexx && indexo != -1 || indexx == -1 && indexo >= 0) { Console.WriteLine("East"); } else { Console.WriteLine("NA"); } } }