#include #include using namespace std; int main() { string s; cin >> s; int east = 0,west = 0; for(int i = 0; i < s.length(); i++){ if(s[i]=='O'){ east++; west = 0; if(east == 3){ cout << "East\n" << endl; return 0; } }else{ west++; east = 0; if(west == 3){ cout << "West\n" << endl; return 0; } } } cout << "NA\n"; return 0; }