#include const long long MOD = 1000000007; const int INF = INT_MAX / 2; const long double PI = 3.1415926; #define FOR(i, r, n) for(int i=(ll)(r); i<(ll)(n); i++) #define REP(i, n) FOR(i, (0), n) #define ALL(r) r.begin(), r.end() #define ll long long int using namespace std; vector> vp; vector> vv(110, vector(50, 0)); vector> vt; set st; map mp; int main() { string s; cin >> s; bool isw = false; int cnt = 0; REP(i,s.size()) { if(cnt>=3) { cout << (isw ? "West" : "East") << endl; return 0; } if(s[i]=='O') { if (isw) { cnt = 1; isw = false; } else cnt++; } else { if (isw) cnt++; else { cnt = 1; isw = true; } } } if (cnt >= 3) { cout << (isw ? "West" : "East") << endl; return 0; } else cout << "NA" << endl; }