#include #include #include #define REP(i, a, b) for (int i = int(a); i < int(b); i++) #define dump(s) cerr << __LINE__ << "\t:" << #s << " = " << (s) << endl using namespace std; int main () { string s; cin >> s; char fs = s[0]; int cnt = 0; string ans = "NA"; REP (i, 0, s.size()) { if (fs == s[i]) { cnt++; } else { cnt = 1; } if (ans.size() == 2 && cnt == 3) { if (fs == 'O') ans = "East"; else ans = "West"; } fs = s[i]; } cout << ans << endl; return 0; }