#include using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { string s; cin >> s; if(s.size()<3) { cout << "NA" << endl; return 0; } string win = "NA"; REP(i, s.size() - 2) { if (s[i] == s[i + 1] && s[i] == s[i + 2]) { win = (s[i] == 'O') ? "East" : "West"; break; } } cout << win << endl; return 0; }