import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int east = 0; int west = 0; for(int i = 0 ; i < s.length() ; i++) { if(s.charAt(i) == 'O') { east++; west = 0; if(east == 3) { System.out.println("East"); return; } } else { west++; east = 0; if(west == 3) { System.out.println("West"); return; } } } System.out.println("NA"); } }