using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace programPractice { class Program { static void Main(string[] args) { string marubatsu = Console.ReadLine(); int w = marubatsu.IndexOf("XXX"); int e = marubatsu.IndexOf("OOO"); if (w == e) { Console.WriteLine("NA"); } else if (e == -1) { Console.WriteLine("West"); } else if (w == -1) { Console.WriteLine("East"); } else if (w < e) { Console.WriteLine("East"); } else { Console.WriteLine("East"); } } } }