#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int i=0; i=b; --i) #define ALL(c) (c).begin(), (c).end() typedef long long ll; typedef vector VI; typedef vector VL; typedef vector VVI; typedef pair P; typedef pair PL; int main() { string s; cin >> s; REP(i,s.length()){ if (s.substr(i,3) == "OOO"){ cout << "East" << endl; return 0; } if (s.substr(i,3) == "XXX"){ cout << "West" << endl; return 0; } } cout << "NA" << endl; return 0; }