#include #include #include #include using namespace std; int main(){ string s; int count=1,flag=0,i; cin >> s; for(i=1;s[i]!='\0';i++){ if(s[i]==s[i-1]){ count++; if(count==3){ if(s[i]=='O'){ cout << "East"; return 0; } else{ cout << "West"; return 0; } } } else{ count=0; } } count++; if(count==3&&i>3){ if(s[i]=='O'){ cout << "East"; return 0; } else{ cout << "West"; return 0; } } cout << "NA\n"; return 0; }