package sg20170226; import java.util.Scanner; public class No_486 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int W = 0; int L = 0; for (int i = 1; i <= s.length(); i++) { String s2 = s.substring(i - 1, i); if (s2.equals("O")) { W++; L = 0; } else if (s2.equals("X")) { L++; W = 0; } } if (W >= 3) { System.out.println("East"); } else if (L >= 3) { System.out.println("West"); } else { System.out.println("NA"); } } }