#include using namespace std; #define int long long signed main(){ string str; cin >> str; string w = "XXX"; string e = "OOO"; for(int i = 0; i < str.length() - 2; i++){ if(str.length() < 3) break; string s = str.substr(i, 3); if(s == w){ cout << "West" << endl; return 0; }else if(s == e){ cout << "East" << endl; return 0; } } cout << "NA" << endl; }