#include #include #include #include #include using namespace std; typedef long long lint; #define MIN(a,b) ((a)<(b)?(a):(b)) #define MAX(a,b) ((a)>(b)?(a):(b)) int main() { char fst, sec, thd; string S; cin >> S; if (S.size() < 3) { cout << "NA" << endl; return 0; } sec = S[0]; fst = S[1]; for (int i = 2; i < S.size(); i++) { thd = sec; sec = fst; fst = S[i]; if (thd == sec && sec == fst) { cout << (fst == 'O' ? "East" : "West") << endl; return 0; } } cout << "NA" << endl; return 0; }