#include #include #include #include #include #include using namespace std; int main(void) { string str; int west = 0, east = 0; cin >> str; for (int i = 0; i < str.size(); i++) { if (str[i] == 'O') { east++; west = 0; } else if (str[i] == 'X') { west++; east = 0; } if (west >= 3) { cout << "West" << endl; return 0; } else if(east >= 3) { cout << "East" << endl; return 0; } } cout << "NA" << endl; return 0; }