using System.Collections.Generic; using System; using System.Drawing; namespace yukicoder { class Program { static void Main(string[] args) { var S = Console.ReadLine(); string[] str = new string[S.Length]; for (int i = 0; i < S.Length - 2; i++) { if (S.Length < 3) { Console.WriteLine("NA"); break; } str[i] = S.Substring(i, 3); if (str[i] == "OOO") { Console.WriteLine("East"); break; } else if (str[i] == "XXX") { Console.WriteLine("West"); break; } else if (i == S.Length - 3) { Console.WriteLine("NA"); break; } } if (S.Length < 3) { Console.WriteLine("NA"); } } } }