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