#include #include #include #include int main() { std::string s; int o, x; o=0;x=0; std::cin >> s; for(auto i = s.begin(); i != s.end(); i++){ if(*i == 'O'){ x = 0; o++; if(o == 3){ std::cout << "East" << std::endl; return 0; } } else if(*i == 'X'){ o = 0; x++; if(x == 3){ std::cout << "West" << std::endl; return 0; } } } std::cout << "NA" << std::endl; return 0; }