#include using namespace std; int main(){ string s; cin >> s; for(int i = 0, e = 0, w = 0; i < s.size(); i++){ if(s[i] == 'O'){ e++; w = 0; }else{ w++; e = 0; } if(e >= 3 || w >= 3){ cout << (e >= 3 ? "East" : "West") << endl; return 0; } } cout << "NA" << endl; }