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