//No.486 3 Straight Win(3連勝) #include using namespace std; int main() { int i; int iE; int iW; char S[ 110 ]; char C; cin >> S; iE = 0; iW = 0; i = 0; C = S[ i ]; while( C != '\0' ) { if( C == 'O' ) { iE++; iW = 0; if( iE >= 3 ) { cout << "East" << endl; return 0; } } else if( C == 'X' ) { iE = 0; iW++; if( iW >= 3 ) { cout << "West" << endl; return 0; } } i++; C = S[ i ]; } cout << "NA" << endl; return 0; }