#include #include #include #include using namespace std; int max(int a, int b) { int x = (a > b) ? a : b; return x; } int min(int a, int b) { int x = (a < b) ? a : b; return x; } int main() { string s; cin >> s; int e = 0, w = 0; bool judge = true; for (int i = 0; i < s.length(); i++) { if (s[i] == 'O') { e++; w = 0; } else if (s[i] == 'X') { w++; e = 0; } if (e == 3) { cout << "East" << endl; judge = false; break; } if (w == 3) { cout << "West" << endl; judge = false; break; } } if (judge)cout << "NA" << endl; return 0; }