#define _GLIBCXX_DEBUG #include using namespace std; int main() { string S; cin >> S; int E = 0, W = 0; for(int i = 0; i < (int)S.size(); i++){ if(S[i] == 'O'){ E++; if(E == 3){ cout << "East" << endl; return 0; } W = 0; }else{ W++; if(W == 3){ cout << "West" << endl; return 0; } E = 0; } } cout << "NA" << endl; }