#include #include #include #include #include //--------------------------- using namespace std; //--------------------------- #define REP(i,n) for(int i = 0; i < (n); i++) #define P(x) cout << (x) << "\n" //--------------------------- int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); string s;cin >> s; int a = s.size(); if (a < 3) { P("NA"); } REP(i,a - 2){ if ((s[i] == 'O' && s[i+1] == 'O' )&& s[i+2] == 'O') { P("East"); break; }else if (s[i] == 'X' && s[i+1] == 'X' && s[i+2] == 'X') { P("West"); break; }else if (i == a - 3) { P("NA"); break; } } return 0; }