#include #include int main(void){ char S[101]; int W=0,E=0,i; scanf("%s", S); for (i = 0; S[i] != 0; i++) { if (S[i] == 'O' && S[i+1] == 'O' && S[i+2] == 'O') { E += 1; printf("East"); break; } if (S[i] == 'X' && S[i + 1] == 'X' && S[i + 2] == 'X') { W += 1; printf("West"); break; } } if (W == 0 && E == 0) { printf("NA"); } }