#include using namespace std; int main(void){ char c; int f = 0; while(cin >> c && c != '\n'){ if(c == 'O'){ if(f < 0) f = 0; f++; }else{ if(f > 0) f = 0; f--; } if(f == 3){ cout << "East" << endl; return 0; }else if(f == -3){ cout << "West" << endl; return 0; } } cout << "NA" << endl; }