#include #include using namespace std; int main(){ string S; cin >> S; bool if_east = false; int continuity = 0; for(int i = 0; i < S.size(); i++){ if((if_east && S[i] == 'O') || (!if_east && S[i] == 'X')){ continuity++; }else{ if_east = (if_east + 1) % 2; continuity = 1; } if(continuity == 3){ if(if_east){ cout << "East" << endl; }else{ cout << "West" << endl; } return 0; } } cout << "NA" << endl; }