#include #include int main(void) { int i,l,a = 0,b = 0,n = 1; char s[128]; scanf("%s",s); l = strlen(s); for(i = 0;i < l;i++){ if(s[i] == 'O'){a++;b = 0;} else if(s[i] == 'X'){a = 0;b++;} if(a >= 3){printf("East\n");n = 0;break;} if(b >= 3){printf("West\n");n = 0;break;} } if(n){printf("NA\n");} return 0; }