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