#include int main() { char S[101]; fgets(S, 101, stdin); int i, len = 0, last = '\0'; for (i = 0; S[i]; i++) if (last == S[i]) { if (++len >= 3) { puts((last == 'O') ? "East" : "West"); return 0; } } else { len = 1; last = S[i]; } puts("NA"); return 0; }