#include #include using namespace std; int main(void) { size_t east, west; string s; cin >> s; east = s.find("OOO", 0); west = s.find("XXX", 0); if (east < west) { cout << "East" << endl; } else if (east > west) { cout << "West" << endl; } else{ cout << "NA" << endl; } return 0; }