#include #include using namespace std; int main(int argc, const char* argv[]) { int a, b; string s; cin >> s; int n = s.length(); int west = 0; int east = 0; for (int i = 0; i < n; i++) { char c = s.at(i); if (c == 'O') { east++; west = 0; } if (c == 'X') { west++; east = 0; } if (east == 3) { cout << "East" << endl; return 0; } if (west == 3) { cout << "West" << endl; return 0; } } cout << "NA" << endl; return 0; }